Jump to content

DieFeM

Supporter
  • Posts

    868
  • Joined

  • Last visited

Posts posted by DieFeM

  1. My suggestion:

    Event/Function ToInitilaize()
    	RegisterForDistanceGreaterThanEvent(Center, NPC, X)
    	RegisterForDistanceLessThanEvent(Center, NPC, X)
    endEvent/Function
    
    Event OnDistanceLessThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance)
    	RegisterForDistanceGreaterThanEvent(Center, NPC, X)
    	;Equip hazmat
    endEvent
    
    Event OnDistanceGreaterThan(ObjectReference akObj1, ObjectReference akObj2, float afDistance)
    	RegisterForDistanceLessThanEvent(Center, NPC, X)
    	;Unequip hazmat
    endEvent

    PS: RegisterForDistanceX registers to receive a single OnDistanceX event, so that you need to register again each time a distance event is received.

    9k18nu.jpg

    • Like 1
  2. Check the first example here: https://falloutck.uesp.net/wiki/RegisterForMagicEffectApplyEvent_-_ScriptObject

    Note that it registers a single event, so you'd need to re-register on every event to continuously checking for magic effects applied.

    For example:

    Event OnInit()
    	RegisterForMagicEffectApplyEvent(Game.GetPlayer())
    EndEvent
    
    Event OnMagicEffectApply(ObjectReference akTarget, ObjectReference akCaster, MagicEffect akEffect)
    	;/ do your thing /;
    	Debug.Trace(akCaster + " applied the " + akEffect + " on " + akTarget)
    	;/ re-register for next effect /;
    	RegisterForMagicEffectApplyEvent(Game.GetPlayer())
    EndEvent

     

  3. Game.GetPlayer() returns an Actor, but akReference is an ObjectReference, I'd say you need to cast the player to an ObjectReference: if akReference == (PlayerRef As ObjectReference)

    but there's another thing, akReference is not meant to be the Actor who equiped the object, but the reference of the object that was equiped by the actor.

    https://falloutck.uesp.net/wiki/OnItemEquipped_-_Actor

    • akReference: The reference that the actor just equipped - if the reference is persistant. Otherwise, None.
  4. Yeah, complex conditions are a headache. There's documentation on how to use them, but the lack of parenthesis makes it an absolute mess.

    Quote

    For example, the expression

    • ((A AND B) OR (C AND D))

    Can be represented by the logically equivalent list of Condition Items

    • (A OR C AND B OR C AND A OR D AND B OR D).

    https://ck.uesp.net/wiki/Category:Conditions#Complex_Conditions

    You have to have a very clear mind to try to make any sense of that gibberish.

  5. 4 minutes ago, Lollia said:

    Hold the phone... 🫢 Can I do that? I was under the impression that if I made all the companion checks ANDs that it would fail, because not all of the checked companions could be currently following at the exact same time.

    Well, not all companions can be currently following you at the exact same time, that's right, and that's why the first example works, but all companions can be "NOT following" you at the same time, that's the point.

    So when you check if they are not following you, you need to use AND, because none (AND) of them should be following you, as opposite to any (OR) of them should be following you.

    So when you use OR, as soon as one of them is true the whole stack of contiguous OR is true.

     

    • Like 1
  6. 9 hours ago, Lollia said:

    Now here's a sample of the conditions to ALLOW certain dialogue responses to play if some of the vanilla companions are NOT CURRENTLY following the player:

    PL      GetValuePercent      Actor Value: 'Health'                >            0.50        AND
    PL      GetLevel                       NONE                                      >=          55.00      AND
    R        GetInFaction              CurrentCompanionFaction     ==         0.000      OR       (Danse)
    R        GetInFaction              CurrentCompanionFaction     ==         0.000      OR       (Deacon)
    R        GetInFaction              CurrentCompanionFaction     ==         0.000      OR       (Nick)

    This one is a rebel and does not work in the slightest degree. It delights in ignoring the CurrentCompanionCondition when it is set to 0. INFURIATING. 😡

    With this condition, no matter what companion you have, or if you have any, it's always to be true as soon as you meet the health and the level.

    For example, if you have Danse as companion, Deacon and Nick would still return 0. Since you're using OR it will always be true, because there is going to be at least 2 of them that are not your companion.

    The solution would be to use AND instead. Danse is not your current companion AND Deacon is not your current companion AND Nick is not your current companion.

    • Confused 1
  7. I suspect the problem is that most fixes rely on a very small number of individuals, maybe just one or two people, which have very rare skills, like making plugins for F4SE and interface mods. In which mods rely many of the DLC sized mods, like, for example, pipboy tabs and extended dialogue interface. They probably are doing their best effort to get these mods working again, but I'm certain they are waiting for bethesda to stop throwing updates, so I'd say we'd need to wait at least a month, maybe.

  8. So, I was scraping things at bunker hill, when I've found something was different, the pillars look like they don't belong there, so that I've search for some screenshot in Google, and yes, they are different than they used to be, is that something from my mods, or they changed them in the next-gen update? 

    My game now:

    ASqW9T.jpg

     

    How it used to be:

    EWo0tc.jpg

  9. No idea how NV does it, sorry. What I've observed is that each limb (or limbs combination) has it's own swf file in the ConditionClips folder, so you would need to create each of the poses of the animation for each limb swf and replace them, I guess you could place the same image in all frames and get a static image if it is too many combinations to draw, also the head is located in a separate swf file, so you need to make sure all your drawings have the head in the same relative position. 

    I'd try to implement just the healthy body and head, and if it works then go with the broken limbs.

    Good luck.

  10. Nifskope used to show textures from vanilla models if I had the resources configured in the settings which is, usually, automatically configured upon installation.

    But now it fails to load all textures, I guess it happens for the same reason xEdit didn't load archives until it got an update that allowed this newer version.

    So, my question is: Is there's any beta or maybe a third party version of nifskope which is able to load next gen ba2 archives?

    Also that could be a misconfiguration on my part, in which case, could anyone tell me if nifskope is actually working with next gen archives?

     

    Thanks in advance.

  11. Whilst using Archive2.exe to pack a lot of new assets, which most never were packed before, I noticed it detects invalid texture formats, among other errors, so it processes the input files. I mean, it does not just pack them like zip or tar. So my guess is that the processing of the files is what has been updated, it probably performs tests that it didn't do before, so I think that this testing, by the output file, doesn't make any difference if the input was already processed, but the new version assumes that certain problems don't occur in an archive packed within this version.

  12. It seems they have a test version in discord which has support for the new ba2 version. 

    https://github.com/TES5Edit/TES5Edit/issues/1322

    Quote

    The BA2 version of some archives was updated with the NG release. As always we have updated builds on Discord. Currently we have an 4.1.5e test build in the #feedback channel for testing posted 4/25/2024. It is currently the most recent pinned message in that channel. We also hope to have an 4.1.5f build with additional updates posted soon to both GitHub and NexusMods for those who can't or won't go to Discord.

     

  13. I'd suggest to test it in a new game instead of a saved game.

    The actors in the CK are "base actors", a kind of "template", when you place it in the world it becomes a "reference" of this base actor, once the actor is a reference it has its own inventory, and its content is unrelated to the base actor.

    There are a couple of ways to add things to the inventory of a reference, by a script or a quest alias, and you can only remove things from it using a script or, obviously, in game, trading.

    Therefore, having this in to account, loading from a new game it will create a new reference from your modded base actor.

  14. The wiki at https://wiki.bethesda.net/, but its down for maintenance. Fortunately for us there's a clone https://falloutck.uesp.net/wiki/ObjectReference_Script

    Check each object page for a list of functions and events, by hierarchy they inherit, so for example an Actor script will be able to use ObjectReference functions and events.

    There you have a list of objects:

    https://falloutck.uesp.net/wiki/Category:Script_Objects

  15. You need to attach the script to each terminal, the script attached to the parent terminal will not affect to the submenu terminal. So that it would need some way to share the instance ID of the sound in order to stop the sound from other menus (terminals). Id go with a global property.

    The same script would be attached to all of the terminals in the menu, they would use the same global to store the sound instance ID (but they can use different sounds in their properties), so that when you run a menu item it will stop the sound instance no matter what terminal started it.

    Scriptname SancHawthorneTerminalScript extends Terminal
    
    Struct MenuItemSound
    	Int MenuID
    	{The ID of the menu item (second column)}
    	Sound Sfx
    	{The the sound to play on this menu item}
    EndStruct
    
    ;Property Array, needs to be filled in CK
    MenuItemSound[] Property MIS Auto
    {Stores relationship between menu items and sounds}
    GlobalVariable Property LastSoundInstance Auto
    {Fill with the same GlobalVariable in all related terminals}
    
    
    Event OnMenuItemRun(int auiMenuItemID, ObjectReference akTerminalRef)
    	; Lets try to stop the previous sound (if any)
    	If LastSoundInstance.GetValueInt() > 0
    		Sound.StopInstance(LastSoundInstance.GetValueInt())
    		; The instance doesn't exist anymore, let's clear the value
    		LastSoundInstance.SetValueInt(0)
    	EndIf
    	
    	; Find the sound struct for the current menu item
    	Int i = MIS.FindStruct("MenuID", auiMenuItemID)
    	;Check if it found a valid item in the array (I'm testing with no sounds in submenus)
    	If i >= 0
    		; play the sound and store the current sound instance so it can be stopped when entering another menu item.
    		LastSoundInstance.SetValueInt(MIS[i].Sfx.Play(akTerminalRef))
    	EndIf
    EndEvent

     

    terminaltestsounds_global.zip

  16. There you have my approach, using the terminal script instead of fragments, though:

    Scriptname SancHawthorneTerminalScript extends Terminal
    
    Struct MenuItemSound
    	Int MenuID
    	{The ID of the menu item (second column)}
    	Sound Sfx
    	{The the sound to play on this menu item}
    EndStruct
    
    ;Property Array, needs to be filled in CK
    MenuItemSound[] Property MIS Auto
    
    ;Global Script Variable
    Int LastSoundInstance = 0
    
    Event OnMenuItemRun(int auiMenuItemID, ObjectReference akTerminalRef)
    	; Lets try to stop the previous sound (if any)
    	If LastSoundInstance > 0
    		Sound.StopInstance(LastSoundInstance)
    		; The instance doesn't exist anymore, let's clear the value
    		LastSoundInstance = 0
    	EndIf
    	
    	; Find the sound struct for the current menu item
    	Int i = MIS.FindStruct("MenuID", auiMenuItemID)
    	; play the sound and store the current sound instance so it can be stopped when entering another menu item.
    	LastSoundInstance = MIS[i].Sfx.Play(akTerminalRef)
    EndEvent

     

    terminaltestsounds.zip

×
×
  • Create New...