Jump to content

[LE] Quick Questions, Quick Answers


Recommended Posts

Sorry to have to come back to this again, but I just can't seem to get foamyesque's script to work. As with previous attempts, my reference alias gets filled the first time but never a second time. I dropped the "remove" function and nothing changed; that doesn't seem to be the issue. I tried directly pointing to the chest I'm refilling instead of using GetRef() (see below - and yes, I filled the property), but again to no avail. I added a debug notification which is firing correctly. I initially had the "Allow Reuse in Quest" box ticked. Un-clicking that box had no effect. I don't understand why the inventory is only be added the first time. I initially was only adding a single leveled list to the reference alias inventory. Thinking that could be an issue, I added a particular item to the inventory. Again, that item was added initially but was never refilled. This is driving me crazy why this won't refill.

Scriptname MIOS_InventoryReset extends ReferenceAlias  
{Resets items added to inventory every 48 hours}

FormList Property ItemList Auto
ObjectReference Property myRef Auto

Event OnInit()
    RegisterForSingleUpdateGameTime(48)
EndEvent

Event OnUpdateGameTime()
    RegisterForSingleUpdateGameTime(48)
    RemoveItems()
    AddItems()
EndEvent

Function RemoveItems()
;	GetRef().RemoveItem(ItemList, 10000)
EndFunction

Function AddItems()
;	ObjectReference myRef = GetRef()
	Clear()
	ForceRefTo(myRef)
	Debug.Notification("This should work...")
EndFunction
Edited by candlepin
Link to comment
Share on other sites

missing meshes in creation kit. Do I need to unpack all my BSAs?

 

i tried adding all my bsas to the creation kit ini (there were 87 of them, I typed them all) and it isn't working. missing meshes everywhere. not missing in game.

Edited by marokay
Link to comment
Share on other sites

 

Sorry to have to come back to this again, but I just can't seem to get foamyesque's script to work. As with previous attempts, my reference alias gets filled the first time but never a second time. I dropped the "remove" function and nothing changed; that doesn't seem to be the issue. I tried directly pointing to the chest I'm refilling instead of using GetRef() (see below - and yes, I filled the property), but again to no avail. I added a debug notification which is firing correctly. I initially had the "Allow Reuse in Quest" box ticked. Un-clicking that box had no effect. I don't understand why the inventory is only be added the first time. I initially was only adding a single leveled list to the reference alias inventory. Thinking that could be an issue, I added a particular item to the inventory. Again, that item was added initially but was never refilled. This is driving me crazy why this won't refill.

Scriptname MIOS_InventoryReset extends ReferenceAlias  
{Resets items added to inventory every 48 hours}

FormList Property ItemList Auto
ObjectReference Property myRef Auto

Event OnInit()
    RegisterForSingleUpdateGameTime(48)
EndEvent

Event OnUpdateGameTime()
    RegisterForSingleUpdateGameTime(48)
    RemoveItems()
    AddItems()
EndEvent

Function RemoveItems()
;	GetRef().RemoveItem(ItemList, 10000)
EndFunction

Function AddItems()
;	ObjectReference myRef = GetRef()
	Clear()
	ForceRefTo(myRef)
	Debug.Notification("This should work...")
EndFunction

 

That's peculiar. I *know* this approach works. Let me prototype up a full quest and hook it together to check.

 

EDIT:

 

Figured it out, and it's my fault, because I forgot to mention it: The quest alias needs to be set to Optional, in order to make the Clear()/ForceRefTo() sequence work correctly.

Edited by foamyesque
Link to comment
Share on other sites

 

Figured it out, and it's my fault, because I forgot to mention it: The quest alias needs to be set to Optional, in order to make the Clear()/ForceRefTo() sequence work correctly.

 

Yup, that completely solved the issue! Thanks so much!

 

Just out of curiosity, is the Optional tag required because Clear() doesn't work with a non-optional reference alias?

Link to comment
Share on other sites

 

 

Figured it out, and it's my fault, because I forgot to mention it: The quest alias needs to be set to Optional, in order to make the Clear()/ForceRefTo() sequence work correctly.

 

Yup, that completely solved the issue! Thanks so much!

 

Just out of curiosity, is the Optional tag required because Clear() doesn't work with a non-optional reference alias?

 

 

That's correct. It isn't documented on the wiki, but if you try, it will throw an error to log, like so:

 

 

[02/26/2018 - 01:07:33PM] Error: alias BelethorsGeneralGoodsChest on quest foam_MerchantChestAdder (C5000D62): Cannot clear a non-optional alias.    
stack:    
    [alias BelethorsGeneralGoodsChest on quest foam_MerchantChestAdder (C5000D62)].foam_MerchantChestAlias.Clear() - "<native>" Line ?
    [alias BelethorsGeneralGoodsChest on quest foam_MerchantChestAdder (C5000D62)].foam_MerchantChestAlias.AddItems() - "foam_MerchantChestAlias.psc" Line 21
    [alias BelethorsGeneralGoodsChest on quest foam_MerchantChestAdder (C5000D62)].foam_MerchantChestAlias.OnUpdateGameTime() - "foam_MerchantChestAlias.psc" Line 13
Link to comment
Share on other sites

I want to check if the PC has any disease via script and I found this exact example and thought it would fit perfectly.

 

https://www.creationkit.com/index.php?title=HasMagicEffectWithKeyword_-_Actor

; Does the player have some kind of disease?
if (Game.GetPlayer().HasMagicEffectWithKeyword(Disease))
  Debug.Trace("The player has a disease")
endIf

 

I copied it, went to fill the property and I don't see any keyword that matches. What gives? Is there another way to do it?

 

Edit: Found a work around by using a spell and having the GetDisease() condition in there.

 

I have another question regarding having explosions with enchantments. I pretty much copied an existing enchantment that works on an explosion. I changed a few visuals(hit shader) and resistance with my copy, thought nothing of it and assumed it was working but it turns out it isn't. Is there some strange setting that must be present for the enchant effect to work?

Edited by Elias555
Link to comment
Share on other sites

  • 2 weeks later...

Appropriately quick question: does anyone know of a way to determine when the player has successfully picked a lock? I'd like to have a chance to add something to the player's inventory when they successfully pick a lock (but not when they use a key). Any help would be appreciated!

Link to comment
Share on other sites

Appropriately quick question: does anyone know of a way to determine when the player has successfully picked a lock? I'd like to have a chance to add something to the player's inventory when they successfully pick a lock (but not when they use a key). Any help would be appreciated!

Inigo uses this to make comments after the player successfully picks a lock or disarms a trap. The game treats picking a lock and disarming a trap as a single event, so Gary had to modify his original comments so they would all make sense no matter whether the player just disabled a trap or picked a lock.

Event OnTrackedStatsEvent(string asStatFilter, int aiStatValue)
    if asStatFilter == "Locks Picked" && (aiStatValue % 3) == 0 ; every third success
        Utility.Wait(1.0)
        InigoRef.Say(InigoCommentOnPickedLock)  ; or a disarmed trap!
    endif
EndEvent

Event OnInit()
    RegisterForTrackedStatsEvent()
EndEvent
Link to comment
Share on other sites

Hi all!

 

I have a question about conditions:

Is there a way to check in a condition whether or not the currently used magic effect is an enchantment?

 

I already did the condition "EPMagic_SpellHasKeyword: MagicShout==0" so it checks that it's not a shout.

But I wasn't able to find a keyword for spell or enchantment (damage enchantment in particular - not a single type of elemental damage).

 

Is there a way to check it?

Not necessarily with "EPMagic_SpellHasKeyword", any other condition will do just fine.

 

Thanks in advance!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...