Jump to content

ThatGuyYeah

Premium Member
  • Posts

    158
  • Joined

  • Last visited

Posts posted by ThatGuyYeah

  1. So, I think I solved it and to not torture some future person that will run into this situation, I am going to explain it.

     

    My theory turned out to be true in that the forcegreet package needs to really be triggered through some EVENT to work properly. You can trigger it with a variable method, which is what I was doing. But for some reason, the package DOES NOT LIKE this and will break off after the first topic.

     

    My solution is simple, once my variable reaches a certain value, I register for a single update (about 10 seconds), it will fire off the EVENT trigger OnUpdate and the forcegreet will trigger as is and the dialogue will continue to the next topic.

     

    Taking what Psy said last, I moved the topic from the working FG to the non-working one to see if that made a difference and it worked as is as well. That fueled my speculation that it does not like non-event triggers.

     

    I am going to run some testing this weekend and give a better update/100% confirm it, but that's pretty much it. The forcegreet must have some EVENT trigger. If you want to do it dynamically (without trigger box at a location), just do a register for single update for a few seconds.

     

    Here's the list of events you can use: https://www.creationkit.com/index.php?title=Category:Events

  2. Here's the weird thing, when I was making the audio and doing the testing, they are not fuzzed, yet

     

    But when I prep a mod for release, they are 're-fuzzed' for space saving purposes.

     

    Here's the kicker, the forcegreet that is tied to a trigger box is working with the fuz file as I released it with Version 0.5RBeta of the mod.

     

    It's an interesting theory and something I should look out for in the future, but I don't think that is it.

  3. Thanks for the replies, I will do a more detailed answer to it tomorrow but I wanted to reply to one person.

     

     

    I looked at the link, but its hard to say without looking at it myself:

    10 hours ago, SmedleyDButler said:

    ThatGuyYeah is trying his damnedest to sort out a Forcegreet issue which is holding up his Overhaul of Serana's Dialogue and relation mod. Just figured I'd crosspost and ask here just in case one of you might have some experience with this.

     

    You can see the details here: https://forums.nexusmods.com/index.php?/topic/6426396-forcegreet-dialogue-will-not-continue-after-first-dialogue/&do=findComment&comment=57898326

    In the package conditions, is the get stage condition set right to move the dialog quest forward?

    Is the "must complete " box checked under the "flags" tab of the package?

    What about the conditions in the dialog, Values set properly? Set stage set?

    Are you using the "invisible continue box" or the "link to" box below it to link to the forced greet quest?

    Is the "goodbye box" checked in the dialog box?

    Also, to troubleshoot, have you tried taking the quest that is working, duplicating it, and linking it to the one you are having issues with, crossing the forcegreet packages, and quest, it might help narrow it down

    just for the record, I am not talking to you like its something you might no have already checked, just things I can think of off the top of my head

     

     

    I did click and unclick must complete and ran the game and still the same issue on either choice.

     

    The goodbye box is only checked in the last topic.

     

    I only set a stage in the first topic, to prevent bleedover.

     

    I ran an experiment using link to and invisible continue on two different forcegreets and still the same issue.

     

    The last part I did not do but I will do when I get home tonight.

     

    Lastly, I appreciate any help and I just said the let's assume I am not an idiot because I just wanted to skip the whole 'turning it off and on again' procedure as I already have done it.

     

    @Tasheni - I will give you a more detailed response tomorrow as I wanted to fire at this reply as it was easier to write.

     

    But I have a theory as to why that one forcegreet is working and the others are not. I will do this when I get home tonight.

  4. I REALLY hate Forcegreets. Never met anything so infuriating.

     

    Now, for those who helped me with my previous problem with firing a forcegreet without the need of a scene (https://forums.nexusmods.com/index.php?/topic/6266696-putting-this-to-bed-once-and-for-all-forcegreets-through-ai-packing-via-quest-stages/) I thank you as it helped resolve one problem, but it started a whole new issue for me.

     

    My current issue is that I am trying to do a forcegreet through an alias package and having the dialogue branch continue beyond the first dialogue. Doesn't matter if I do an invisible continue to the second topic or have the player pick the dialogue topic, the dialogue ends after the first topic (the topic that is fired with the forcegreet).

     

    Let's pretend I am not an idiot and I am linking the dialogues topic together properly. I also regenerated the SEQ files. I have tried doing the priority issue that I dealt with previously and it still won't work. For whatever reason, the dialogue will not continue beyond the first dialogue. It also won't work for scenes either.

     

    Each forcegreet is controlled by its own quest and stages.

     

    And to add to the weirdness of my dilemma, I do have one forcegreet that triggers at a location (via trigger box) and that works without a problem. It will continue to the second topic and there is no issue.

     

    But for some reason, doing this dynamically, I can get the forcegreet to trigger but I can't the get second dialogue to fire after the first forcegreet dialogue happens. Meaning if I have a dialogue branch like this:

     

    Topic 1 (Forcegreet) -Link-> Topic 2 -Link-> Topic 3

     

    This happens instead:

     

    Topic 1 (Forcegreet) -Dialogue End -> Branch Ends

     

    If I click on the NPC, the dialogue topic is there and I can branch normally.

     

    At this point, I have no idea what is going on, so I am asking for help on this one as it is really holding my mod up. Thank you.

  5. Hello,

     

    I have been tinkering with Fallout 4 CK (while taking a break from Skyrim modding here and there) and wanted to understand some mechanics of Fallout 4 mod, in particular weapon modding.

     

    There are some fixes and tweaks I have been adding for my game and one thing I wanted to understand is how to implement Weapon Skill perks (Rifleman/Commando/Gunslinger) into a weapon mod. In particular, say you have two different weapon grips, one that is geared for a gun and one geared for a rifle, how do you make sure the right perk (Rifleman/Commando/Gunslinger/whatever) is implemented into the right stock/weapon mod.

     

    Thanks for your time.

  6. I just wanted to make sure that my code seems valid. I have ran several test and it seems fine, but I wanted to make sure it will be fine with a person's game (i.e. no save bloat issues or anything like that). Pretty much this code is my second brain for Serana, which keeps my variables and the relationship mechanic. I will make calls to these functions based on dialogue choices, which will use a fragment script which calls a function in the main script here.

     

    I am 95% sure it should be fine, but I just want some external input as a sanity check.

     

     

     

    Scriptname SDECustomMentalModel extends Quest  Conditional
    {Serana Dialogue Edit Custom Mental Model Script}
    
    Bool Property SDEElderScrollFlirt = False Auto  Conditional
    {DLC1VQ03 Flirted With Player During Scroll Talk - Default = False}
    
    Bool Property SDEFirstAdmire = False Auto  Conditional
    {First Time Admiring Player - Default = False}
    
    Bool Property SDEFirstIdolize = False Auto  Conditional
    {First Time Idolizing Player - Default = False}
    
    Bool Property SDEFirstDespise = False Auto  Conditional
    {First Time Despising Player - Default = False}
    
    Bool Property SDEFirstCondemn = False Auto  Conditional
    {First Time Condemning Player - Default = False}
    
    Bool Property SDEFirstTolerate = False Auto  Conditional
    {First Time Condemning Player - Default = False}
    
    Bool Property SDEMentionedInsectPriest = False Auto  Conditional
    {DLC1VQ03 Talked About Themed Insects - Default = False}
    
    Float Property SDEVersion = 0.33 autoReadOnly
    {Mod Version - Default = Current Version}
    
    Int Property SDECMMRelVar = 0 Auto  Conditional
    {Relationship Mechanic - Default = 0}
    
    Int Property SDECMMRelVarPre = 0 Auto  Conditional
    {Relationship Mechanic Previously Before Update - Default = 0}
    
    Quest Property DLC1VQ02 Auto
    {Bloodline Quest Requirement}
    
    ;Some Initialization for the Mod - Comment Out When not in Beta Except for Initial Evaluator
    Event OnInit()
    	Debug.Notification("Serana Dialogue Edit Active! Version: " + SDEVersion)
    	
    	Utility.Wait(1.0)
    	
    	Debug.Notification("Serana Relationship Value: " + SDECMMRelVar)
    	
    	Utility.Wait(1.0)
    	
    	if (DLC1VQ02.GetStage() >= 5) ;If Mod was Loaded After Releasing Serana
    		RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    	endif
    EndEvent
    
    ;Serana Liking Player Action
    Function SeranaLikes()
    	Debug.Notification("Serana Likes That")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar += 1
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Serana Loving Player Action
    Function SeranaLoves()
    	Debug.Notification("Serana Loves That")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar += 3
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Serana Disliking Player Action
    Function SeranaDislikes()
    	Debug.Notification("Serana Dislikes That")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar -= 1
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Serana Hating Player Action
    Function SeranaHates()
    	Debug.Notification("Serana Hates That")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar -= 3
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Auto-Set to Admire - Debug Only
    Function AutoAdmire()
    	Debug.Notification("Auto Admire Engage")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar = 50
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Auto-Set to Idolize - Debug Only
    Function AutoIdolize()
    	Debug.Notification("Auto Idolize Engage")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar = 100
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Auto-Set to Despise - Debug Only
    Function AutoDespise()
    	Debug.Notification("Auto Despise Engage")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar = -50
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Auto-Set to Condemn - Debug Only
    Function AutoCondemn()
    	Debug.Notification("Auto Condemn Engage")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar = -100
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Auto-Set to Tolerate - Debug Only
    Function AutoZero()
    	Debug.Notification("Auto Zero Engage")
    	
    	SDECMMRelVarPre = SDECMMRelVar
    	
    	SDECMMRelVar = 0
    	
    	RelationshipEvaluator(SDECMMRelVarPre, SDECMMRelVar)
    EndFunction
    
    ;Evaluates the Relationship of Serana - Checks Relationship Value for Overflow & Let's Player Know if Serana Hit Relationship Status for the First Time
    Function RelationshipEvaluator(int PastValue, int CurrentValue)
    	;Checks Current and Previous Value, if Player Reaches Status Threshold for First Time, Player get Notification
    	if ((CurrentValue > 49) && (PastValue <= 49) && (SDEFirstAdmire == false))
    		Debug.Notification("Serana Admires You")
    		SDEFirstAdmire = true
    	elseif ((CurrentValue > 99) && (PastValue <= 99) && (SDEFirstIdolize == false))
    		Debug.Notification("Serana Idolizes You")
    		SDEFirstAdmire = true
    	elseif ((CurrentValue < -49) && (PastValue >= -49) && (SDEFirstDespise == false))
    		Debug.Notification("Serana Despises You")
    		SDEFirstDespise = true
    	elseif ((CurrentValue < -99) && (PastValue >= -99) && (SDEFirstCondemn == false))
    		Debug.Notification("Serana Condemns You")
    		SDEFirstCondemn = true
    	elseif ((CurrentValue == 0) && (PastValue == 0))
    		Debug.Notification("Serana Tolerates You")
    	endif
    	
    	;Checks Current and Previous Value, if Player Drops Below Threshold for the First Time, Player get Notification - Some Degree of Tolerance Allowed
    	if ((CurrentValue < 30) && (PastValue >= 30) && (SDEFirstAdmire == true))
    		Debug.Notification("Serana Tolerates You")
    		SDEFirstAdmire = false
    	elseif ((CurrentValue < 70) && (PastValue >= 70) && (SDEFirstIdolize == true))
    		Debug.Notification("Serana Admires You")
    		SDEFirstAdmire = false
    	elseif ((CurrentValue > -30) && (PastValue <= -30) && (SDEFirstDespise == true))
    		Debug.Notification("Serana Tolerates You")
    		SDEFirstDespise = false
    	elseif ((CurrentValue > -70) && (PastValue <= -70) && (SDEFirstCondemn == true))
    		Debug.Notification("Serana Despises You")
    		SDEFirstCondemn = false
    	endif
    	
    	;Checks Value of Relationship Variable - if Variable is Over -200 or +200, Set Variable Back to -200/+200
    	if (CurrentValue > 200)
    		SDECMMRelVar = 200
    	elseif (CurrentValue < -200)
    		SDECMMRelVar = -200
    	endif
    	
    	;Send Notification About CurrentValue - Debug Only
    	Debug.Notification("Serana Relationship Value: " + CurrentValue)
    EndFunction
    

     

     

     

    And here is a sample fragment code:

     

     

     

    ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
    ;NEXT FRAGMENT INDEX 1
    Scriptname SDE_DEB__00000001 Extends TopicInfo Hidden
    
    ;BEGIN FRAGMENT Fragment_0
    Function Fragment_0(ObjectReference akSpeakerRef)
    Actor akSpeaker = akSpeakerRef as Actor
    ;BEGIN CODE
    SDECMMRel.SeranaLikes()
    ;END CODE
    EndFunction
    ;END FRAGMENT
    
    ;END FRAGMENT CODE - Do not edit anything between this and the begin comment
    
    SDECustomMentalModel Property SDECMMRel Auto 

     

     

  7. That's the pretty much the goal. I am aiming for a relationship mechanic (ala Fallout 4) and a remembrance mechanic (ala Telltale Games) for Serana and I know I will be updating the mod and releasing a new update here and there (as I progress the dialogue expansion in Dragonborn and the Main Game).

     

    My fear is that the subsequent updates (when a person is downloading and replacing my mod with the new version MAY reset those variables. I get the suspicion that it might not and I should be fine, but given this is the Creation Kit and Skyrim, I might not be so lucky. I am doing test runs right now to see, but again, I don't know. This is pretty much uncharted territory for me. But considering when Bethesda updates their Update.esm patch, I don't think it would change,

     

    Also, thanks for the link, I'm trying to keep the mod as lightweight as possible with other mod requirements (I even toe the line with the Unofficial Patch). I personally don't want to deal with having to use SKSE as a requirement, but if it does fail, I will look into that more. Thank you.

  8. I am writing scripts for my mod and I know that I will be updating this mod regularly over the next year. My question is about persistence in variables that I will be adding.

     

    My concern is that when I update the mod (not changing the name or anything like that, just adding onto the esp so they will just have to replace the esp) that variables/choices that the players made previously, will be wiped out with the next version of the mod. I hope that is not the case and I will do a few experiments as I build the mod (i.e. making a test save and seeing if the changes I make will reset the values), but I have no idea.

     

    My major concern is that I have a mechanic which is really just a variable that I initialize as 0, but will either go up or down based on player actions. My concern is if a person updates my mod mid game, that value will be knocked back to 0. I am hoping there is some Persistence that it will remain at its default value.

     

    Any feedback would be nice on this.

     

    My second concern is Quest Stages. The variable I mentioned is going to be used a lot through the mod and to save on putting a lot of scripting on the dialogues, I wanted to make a quest handler in order to handle the quest. My approach is to build a quest that has a few stages where each stage where the stages will make the value go up or go down and it is repeatable. I am wondering if this will be a valid and correct approach than the other approach is to heavily script each dialogue choice that will affect it.

     

    The drawback of this is that once a stage hits the highest stage, it will not register going back down (meaning that if you have a stage of 40 then setting the stage so 20 will still make the value 40), but it will still do the actions of the stage 20. It seems weird to me so I would like feedback on this.

     

    Thank you for your time.

  9. 1. Are your sure your alias is being filled? type sqv yourquestname in the console to see if its filled.

     

    2. Set the quest priority to 99 so that the alias takes priority over vanilla quests

     

    3. Set the package's owner quest to your alias quest, and add getstage == 10 to your package conditions. This is most likely why it's not firing.

     

    Alias was loaded and status was set but setting priority to 99 (mine was 60 originally) seemed to have fixed it. Thanks!

     

    Now my next question does setting the quest priority to 99 break other quests?

  10. This has been a bane of my existence for a few years now. Put simply, I am trying to add a simple forcegreet to a follower that is currently following me. For some reason, I get mixed results. The only way I can get it to work is if I use scenes and I believe I can do it with just a simple AI package. Difficulty: It's Serana so chances are her bugged AI is probably causing all sorts of issues.

     

    I need someone to just follow my train of though as I go through my process and point to where I am screwing up.

     

    First, I create a simple Dialogue block to test to see if the dialogue works:

     

     

     

    1UR38Oi.png

     

     

     

    Next, I write a simple AI package for the forcegreet as shown:

     

     

     

    3jeFPZC.png

     

     

     

    Then, I write a simple quest stage progress where stage 10 starts the forcegreet:

     

     

     

    iTOiJEe.png

     

     

     

    Then, I create an alias:

     

     

     

    Huh5pDa.png

     

     

     

    Then, in Stage 10, I write the following:

    Alias_Alias_Serana.getActorReference().evaluatePackage()
    
    Utility.Wait(3.0)
    
    Debug.Notification("Forcegree Active!")
    

    I add the three seconds to see if the package evaluates and a Notification to see if it goes into stage 10.

     

    Then set the stage to 10 and the Notification pops up, but nothing else happens. The package does not evaluate.

     

    At this point, it's been a few years that I have been wrapping my head around this. I really want this demon put to rest so I can move on. Any help will do. If more information is needed, I will add on to it. Thanks again.

  11. The problem with Serana is mostly they kind of left her unfinished and rushed so a LOT of these quirks was because Bethesda didn't really take care of Serana.

     

    Just general laziness/wanting a DLC to be released ASAP were the culprits.

  12. Alright, after tinkering with the code, I manged to get it to work perfectly. If you are wondering how to do it here is what I did:

     

    First, I build a quest for the script and write the main script as follows:

    Scriptname SDE extends Quest  Conditional
    ; This script will poll the character with Serana and see if she is near the player.
    
    DLC1_NPCMentalModelScript Property SDECMM Auto ; Reference other script for following status
    
    ObjectReference Property Serana Auto ; Adds Serana as Reference for Code
    
    int Property X = 0 auto conditional
    
    EVENT OnInit()
        Debug.Trace("OnInit() - Quest 'SDETestCode' is running. " +self) ; Info only
    ENDEVENT
    
    Event OnUpdateGameTime()
        If (self as Quest) && self.IsRunning() ; Make sure mod is still running
    	; Debug.Notification("Seeing this message, code works here.")
    	
            ; Utility.Wait(2.0)
    	
            ; Debug.Notification("Checking other code.")
    	
            ; Utility.Wait(2.0)
    		If (Game.GetPlayer().GetDistance(Serana) < 1024) && (SDECMM.IsFollowing == true)		
    			X += 1 ; Not exact but wanted to add increment to script - will add cap to prevent overflow error
    			
    			; Debug.Notification("Your time with Serana has improved your standing with her.") ; Will shorten
    			
    			RegisterForSingleUpdateGameTime(1.0)
    
    			; if (X == 4)
    				; Debug.Notification("Serana Admires You - Just Kidding.")
    			; EndIf
    		Else
    			Debug.Notification("Code failed At Following.")
    		EndIf
        Else
    		Debug.Notification("Code failed At Check.")
        EndIf
    EndEvent
    

    Next, I implement a simple quest stage (called it 0) with an Empty Log Entry so I can write a simple fragment as so:

    ((self as Quest) as SDE).RegisterForSingleUpdateGameTime(1.0)
    

    With that, the game will check if an in-game hour has passed. Then it will first check to see if the mod is running then it will check to see if Serana is following the player (using her variable that status - will not work for other followers) as well as check if Serana is close by. If all these are true, then my code will do its poll and repeat the cycle in another in-game hour. If any of these fail, the code will stop and will not repeat.

     

    I am hoping someone can check to see if the structure of the code will be safe to use and not cause too much issue with saves (i.e bloat).

     

    Anyone can now modify this code for 24 hours or for other purposes. Also, ignore the semi-colons, I was using that code for debug and commented it out.

  13.  

    The problem is while loops can get nasty in Skyrim and add the script lag and save bloats. I was trying to find a way to avoid that while getting what I am looking at the same time.

     

    I was looking for a safer way of doing this without it killing player's games/saves.

     

    Thank you for clarifying, yeah I had a feeling having this count every 24 hours in a while loop would be problematic. Yeah I started maybe a week ago, and I just got this mind set of what exactly I wanted to make, and ever since then I have just none stopped rammed head first into scripting .... I haven't even made my first simple dungeon yet, and I am already making new crafting systems with modified armor types and other neat stuff, a long side a well optimized and decently designed level.

     

     

    The best advice I can give is make a dummy esp and just do practice scripts there. I mean RegisterforSingleUpdate when doing what I am doing is technically a loop, but it can easily break itself when it is no longer in use (Which is what I am trying to figure out).

     

    But yeah, practice, practice, practice.

  14. So after doing some research, my approach will be as follows:

    Scriptname SDEPollingScript extends Quest
    ; This script will poll the character with Serana and see if she is near the player.
    
    ObjectReference Property Serana Auto ; Adds Serana as Reference for Code
    
    int Property X = 0 auto conditional
    
    SDECustomModelScript Property SDECMM Auto ; Reference other script for following status
    
    EVENT OnInit()
        Debug.Trace("OnInit() - Quest 'SDECMM' is running. " +self) ; Info only
    ENDEVENT
    
    Event OnUpdate()
        If (self as Quest) && self.IsRunning() ; Make sure mod is still running
      
    		If (Game.GetPlayer().GetDistance(Serana) < 256) && (SDECMM.IsFollowing == true)
    			
    			X += 1 ; Not exact but wanted to add increment to script - will add cap to prevent overflow error
    			
    			Debug.Notification("Your time with Serana has improved your standing with her.") ; Will shorten
    			
    			RegisterForSingleUpdateGameTime(24.0)
    			
    		EndIf
    		
        EndIf
    EndEvent
    

    And with Serana's following scripts, I will add the following:

    ((self as Quest) as SDEPollingScript).RegisterForSingleUpdateGameTime(24.0)
    

    Does this hold water?

  15. I am looking for some pointers on the best way to approach doing a simple polling script for an NPC. Essentially, I want this script to check every 24 hours to see if the NPC is following the player and is within a relative distance of the player. If so, the variable I have is incremented by 1 (or whatever value).

     

    I am aware that registerforSingleUpdateGameTime(24) would be the better way of working with what I am doing. So my script would look something like this:

    bool Property bKeepUpdating auto ; Make Global in Script so can be altered by if the NPC is following player
    
    Function StartChain()
        RegisterForSingleUpdateGameTime(24.0) ; Register to be notified every in-game day
    EndFunction
    
    Event OnUpdate()
        ; Add Increment Here
        If bKeepUpdating
            RegisterForSingleUpdateGameTime(24.0)
        EndIf
    EndEvent
    

    My idea is 'simple:' when the NPC is following the player, this script will run. Once the player dismisses the NPC, the script stops until NPC is following the player again.

     

    Any advice would be appreciated.

  16. I've had this problem lingering with me for awhile and since I am now on borrowed time with this new job, I need some honest help with this. I am trying to make an active follower (meaning a follower that is currently following me) do a forcegreet when at certain stages. Unfortunately, I asked about this 6 months ago and I was never able to resolve it. I know how to do it with people that aren't following me and I can only get it to 100% work when working with scenes. But I always felt like there had to be another way of simplifying this. So I am asking someone to give me a better step by step way of doing this.

     

    Here is my approach:

     

    -Create a quest with an alias to use for scene

    -Create a forcegreet package.

    -Create a scene within the quest that contains the package

    -Use papyrus to run a if-statement system with oninit and onupdate with the quest stage being the factor for it.

    -When stage happens, script completes and scene plays out - Forcegreet happens.

     

    My example code:

    Scriptname SDETestScript extends Quest  Conditional
    
    Quest Property DLC1VQ08 Auto
    Scene Property MyScene Auto
    
    Event OnInit()
    	RegisterForSingleUpdate(1.0)
    EndEvent
    
    Event OnUpdate()
    	if (DLC1VQ08.GetStage() == 10)
    		MyScene.Start()
    	else
    		RegisterForSingleUpdate(1.0)
    	endif
    EndEvent
    

    And from there, the forcegreet works without a problem.

     

    But I always felt like there should be a way to do it without a scene and I haven't been able to figure it out. I tried adding a package into an alias and creating a code to evaluate package and it didn't work with the code being:

    Scriptname SDETestScript extends Quest  Conditional
    
    Quest Property DLC1VQ08 Auto
    referencealias Property Alias_Serana Auto
    Scene Property MyScene Auto
    
    Event OnInit()
    	RegisterForSingleUpdate(1.0)
    EndEvent
    
    Event OnUpdate()
    	if (DLC1VQ08.GetStage() == 10)
    		Alias_Serana.GetActorReference().EvaluatePackage()
    	else
    		RegisterForSingleUpdate(1.0)
    	endif
    EndEvent
    

    But that didn't work. So at this point, I have to throw in the towel and hope someone can give me a better way of doing.

     

    Also, (somewhat unrelated) I am planning on using multiple scripts that uses the OnInIt/OnUpdate RegistserForSingleUpdate loop for my mod, my question is will having multiple scripts of these cause any issues like script lap or, heaven forbid, save bloat. I know that if the mod is ever removed that it my through a single error for each script, but I never asked about the lag in scripts or such.

     

    Thank you.

  17. I had a similar issue with that when it came with ... and ' (as Word would make ... as one character instead of 3 and the ' as Word's fancy version of it) and what I would do was take the text and throw them in Microsoft notepad then use the find/replace option to change it to what you want. For example, I would ask notepad to change all of the Word's '...' (since you can copy that character and paste it in the find/replace text bar) and have it be replaced by the actual ...

     

    Hope it helps and what I said wasn't too confusing.

  18. Yeah, it is pretty much the intention. I want to be able to lock out some dialogue if she wasn't there to partake in them (in particular, she shouldn't be talking about the first attack from the cultists in Dragonborn is she wasn't there during that first encounter).

     

    My issue was that I wasn't sure that you could use ObjectReference to point to an actor.

     

    Now, since that is possible, I hope I can pick your brain for one last thing. Let's say I want to add a safety net in case someone loads my mod AFTER said encounter, to prevent a trigger from happening, should I modify the code like this:

    ScriptName SDEDLC2TriggerScript Extends Quest
    
    Quest Property DLC2MQ01 Auto
    ObjectReference Property Serana Auto
    Bool Property SeranaAtDLC21MQ01 = False Auto Conditional
    
    Event OnInit()
        RegisterForSingleUpdate(1.0)
    EndEvent
    
    Event OnUpdate()
        if (DLC2MQ01.GetStage() == 7)
            if (Game.GetPlayer().GetDistance(Serana) < 1024)
                SeranaAtDLC21MQ01 = True
            endif
            UnregisterForUpdate()
        elseif (DLC2MQ01.GetStage() > 7)
            UnregisterForUpdate()
        endif
    EndEvent
    

    That way if someone loads the mod in the middle of the Dragonborn questline, the variable doesn't trigger automatically. Pretty much to prevent an accidental triggering.

  19. I have been wrapping my brain around this one and I am hoping I can get some help with this.

     

    Pretty much, I am trying to add a script that detects the distance that a player is from an NPC once and if that NPC is close to the player, it will turn a variable to true (once a certain quest stage is triggered). The reason for this is to control some dialogue to prevent possible immersion issues. Here is what I have for code:

    ScriptName SDEDLC2TriggerScript Extends Quest
    
    Actor Property PlayerRef Auto
    Quest Property DLC2MQ01 Auto
    ObjectReference Property Serana Auto
    Bool Property SeranaAtDLC21MQ01 = False Auto  Conditional
    
    Event OnInit()
    	RegisterForSingleUpdate(1.0)
    EndEvent
    
    Event OnUpdate()
    	if (DLC2MQ01.GetStage() >= 7)
    		if (Game.GetPlayer().GetDistance(Serana) < 1024)
    			(GetOwningQuest as SDEDLC2TriggerScript).SeranaAtDLC21MQ01 = True
    			UnregisterForUpdate()
    		else
    			UnregisterForUpdate()
    		endif
    	endif
    EndEvent
    

    I know that this will not work because I can't use a getdistance on an actor. But I am hoping for some ideas to get this to work. Thank you.

×
×
  • Create New...