Jump to content

WhiteWolf424242

Premium Member
  • Posts

    130
  • Joined

  • Last visited

Everything posted by WhiteWolf424242

  1. Okay, I tested it, and the local variable way simply doesn't work. After the dialogue ends these scripts stop, and when scripts stop local data is lost. When the dialogue is started again, the script restarts and bReady initializes back to its default value. Therefore if(bReady) is always false, no matter how many times the code has run before it. Thanks for the code samples, but I know how to store it and set it up with external tools like globals I just really, really wanted to avoid it. I've got at least 15 of these fragments, and I didn't want to make 15 global variables for this. These are also edited vanilla dialogues actually and the topic info is not shared, so duplicating everything is again something I didn't want to spend time with. But unless there is some kind of "static" variable option, that survives when it's parent script stops, it looks I have no choice but to do it the arduous way. :/ (Seriously though, given the fact the player can tab out of a dialogue, Bethestda should have added "first time only" support for these fragments in the first place, in my opinion. ) Thanks anyway :)
  2. Hello, What do you think is the best method to limit dialogue script fragments to execute only the first time only? So that if the player tabs out of this dialogue and thus can initiate the topic again, the script fragment won't run the second time. What I don't want to do is manually store the information somewhere else (global, quest variable, some other script property) that it fired and then enclose the fragment code in an if for that value. I have a lot of such fragments that need to be "first time only", so I don't want to create many globals/quest variables for storing this information. I'd like to keep it local. Would it perhaps work to store the information in a private variable of the fragment? So for example, give the dialogue fragment script a bool Executed = false variable outside, and then modify the contents of the CK fragment code so that: If(!Executed) ; contents of the fragment Executed = true Endif Would this work? Or would the variable just reset to its initial value when the script runs the second time (thus preventing the condition from working?) This is the part that I'm unsure of. Do dialogue scripts retain the values of their variables, or are they reset to initials when they run the next time?
  3. I did not know that, thanks. Okay, this is easy to check - I purged all my mods - and there's the intro! Cool. Deploy mods - intro gone. From this I conclude my main inis are fine, and it's indeed one of my mods that's disabling it. I guess I'm up for some hunting then :D @wfandrews: The problem did not come from installing the replacer - as I said in the original post, I haven't seen the original intro either, and for months now. I just didn't realize that it's missing up until now. Since everyone just clicks through the beth logo, I bet many people wouldn't recognize if it was suddenly gone :D But now that I want a replacer, of course I noticed that it's missing.
  4. I don't use any profiling options - I just use Vortex to manage the deployed mods and enabled/disabled esps, and that's it. I'm editing the correct ini files - other changes are applied if I make them. I'm hesitant about BethINI. Firstly I much prefer understanding what each thing does and then set it manually rather than rely on a magic button setting. Secondly, I have already fine-tuned my inis by hand (especially concerning multithreaded stuff), there are mod-specific recommendation edits, therefore I don't want my settings overwritten. Yeah, making a backup is no effort, okay... so I might give BethINI a try and see if it generates an ini that solves the intro... but I'm not very optimistic about the results. The inis should be correct, I didn't make intro-concerned edits. As in the op, I tried adding the sIntroSequence key, it wasn't there before so it was at its default values, like all keys concerning the intro that are listed in the ini guide. Therefore I'm more inclined to suspect that it's a mod. Is it possible for a rogue mod to "dynamically edit" the inis on startup and thus block the intro? Because if that's possible, then I can make all the ini edits I want, the culprit mod will just disable the intro on startup anyway. I have no clue about how to track down exactly which mod could cause this, if this is really the case. (By that I mean, if mods are indeed capable to do this).
  5. Hello, A few days back I discovered a neat intro video replacer (namely this one https://www.nexusmods.com/skyrim/mods/52683 ), and I installed it right away. But jumping into the game, I had to realize - oh my, in fact I had not seen the intro video at all for quite some time now! I mean I didn't even notice - and it's quite a convenience that I didn't have to click through the Bethesda logo anymore, but now that there's this replacer, I want to bring the video back :D Problem is - I no longer remember at what point did it disappear! For starters I tried disabling all my mods that affect the main menu (background, music replacer, and the MainMenu mod for character filtering) - it did nothing, so the culprit is something else. Does anyone know what could be disabling the intro video? I tried manually adding the ini setting for [General] sIntroSequence=BGS_LOGO.BIK in Skyrim.ini, but that also did nothing, still no intro. Thanks for any ideas!
  6. Thanks for the hints, this is super useful :smile: I agree. And for this case, I'll probably stick to the OnLocationChange way. Using the door as an activator makes it too specific - IIRC the Temple of Mara has two doors, one main entrance and one in the basement, and this would then be incompatible with mods that let the player fast travel from interiors (which is something I also use), or otherwise create ways to exit without using a door. I checked in the CK - the Temple Of Mara is actually it's own Location. So for this specific example, I think the OnLocationChange is the most reliable, because no matter how the player or the actor exit this place, this will always trigger (and it's worked perfectly with my tests). Thanks everyone :smile:
  7. Okay, my terminology may not be very well defined (cell, location, etc.), and maybe I use them too interchangeably, sorry for that :sad: (But then again, the wiki doesn't go into great detail about accurately defining what is what) To be absolutely specific for my case: The player and the Actor are in the Temple of Mara. I'd like to hook up the event for when either of them walk out the door. OnLocationChange worked on the player alias when I walked out the door and loaded into Riften. There is this warning in the wiki though: "Keep in mind that Locations can be large groups of multiple cells, sometimes including numerous interior and exterior cells. As a result, this event may not be ideal for use as a general purpose cell movement tracker. Try OnCellLoad or OnCellAttach instead." This makes me wary, but since I don't need the event to fire multiple times, just the first time someone walks out of the Temple of Mara, and that seems to work, maybe I can get away with it? Although it would still be useful to learn how to do a proper cell tracking event. :smile: But when I tried just this on the player alias: Event OnDetachedFromCell() If( just a quest condition that was TRUE - I checked in the console) ; stuff that should happen endif EndEvent "Stuff" didn't happen when I walked out the door.
  8. Hmm, when I used OnDetachedFromCell() in the OP's first code, with just the quest stage condition (which was set there properly), it didn't work like at all. I don't see how adding more conditions to it would help. Also, does a city count as an interior? I doubt it, so then the even wouldn't fire when the player leaves the interior and enters the city. So I think the IsInInterior condition breaks the goal of the event. But it works now well with the OnLocationChange event. Is there a reason why I shouldn't use it and should use something else instead? I've read the some of these load/unload type events are more reliable than others so maybe there's something I should be aware of?
  9. Hello, Unfortunately I'm not very familiar with how Load and Unload events work, so I might need some help. Here's what I'd like to do: The player and an Actor are together in an interior cell. A quest is moved to a stage. I'd like then to have an event that fires when either the player or the Actor move out of this cell (so they are no longer in the same cell and can no longer see each other). The quest stage is unique and thus can be used to filter on. The Actor and the Player are in quest aliases, and the script can be attached to those. I tried the following: Scriptname WW42FailedWeddingCleanupScript extends ReferenceAlias Quest Property WW42WeddingDress Auto Event OnDetachedFromCell() If(WW42WeddingDress.GetStage() == 25) ; stuff that should happen endif EndEvent But this plainly doesn't do anything. It doesn't matter if the player moves out of the cell or the npc, nothing happens. What would be the correct event to use here? EDIT: Seems to work with OnLocationChange(Location akOldLoc, Location akNewLoc), so I guess it's solved ^^ I should google first, only post second.
  10. Oh, I guess that was painfully obvious, wasn't it. Thanks for pointing it out :D Works as expected now :)
  11. Hello, I'm trying to create a method where the player can put together a list of objects that at a later point is set as an outfit for an NPC. The way for the player is to select a dialogue option, then a container is shown into which he can put objects (that can be cast as Armor, so are some piece of armor, jewelry, etc.), and then the contents of the container are used as the new Outfit. In the CK, I have the following objects: - An empty FormList: WW42WeddingDressFormList - A LeveledItem: WW42WeddingDressLeveledItem - An Outfit: WW42WeddingDressOutfit , which in the CK, contains the previous LeveledItem. - A container: DressContainer. Here's the code attached on the container. The idea is that if an object castable as Armor is placed into the container, it is recorded into the FormList. Here's the script that happens when at the dialogue end to set the npc's Outfit (Note: we are not changing the outfit for akSpeaker! You talk to akSpeaker, but the Outfit change will be happening to a different NPC, who is stored in a quest alias.) The point of this fragment is to open the container, allow the player to put the pieces of clothing he wants to be included, and when it's closed, it will copy the contents of the FormList (set up in the container's code) into the LeveledItem. The (GetOwningQuest() as WW42WeddingDressQuestScript).SetWeddingOutfit(akSpeaker) is a call for a quest script that uses the aliases of the quest to record the to-be-changed NPC's current Outfit for later changeback, sets some stages and quest variable stuff - that all works fine. Finally, when the time comes, a quest stage fragment script is the one that actually does the Outfit change. This is just: If( kmyQuest.OutfitSet == 1) ; (note: set by the quest script call described above) Alias_LoveInterest.GetActorReference().SetOutfit(WW42WeddingDressOutfit) else SetObjectiveDisplayed(10, false) Endif My problem with the whole thing: only one item is actually equipped into the new Outfit. Always only one, no matter how many the player puts into the container. If I willingly only put in one object - that shows up correctly. Be it an armor piece, a necklace or even a modded cape, it all works fine, regardless of the actual armor object type. But as soon as I try to put multiple items (say an armor and a necklace and a shoe) into the container, still only one gets equipped by the npc. It seems random - sometimes it's just the shoe, sometimes just the necklace, sometimes just the armor. I'm guessing that the randomness is involved because in the container code's WW42WeddingDressFormList.AddForm(akBaseItem), as far as I know, the exact index where the new form is inserted into the list is not definite. Therefore my guess is that only the first item of the FormList (and thus the first item of the LeveledItem) is inserted into the Outfit, but it's random which item is actually the first in the list, and that's why I see a random pattern. But I just can't figure out what I'm doing wrong. Why is only the first item/only one item in the Outfit? If someone could help by pointing out the problem, that would be greatly appreciated :smile:
  12. Hello, Is it possible to have an Event for when a Quest is moved to a given stage? For example: Quest Property MonitoredQuest Auto Event <???> ; when MonitoredQuest was moved to f.e. Stage 60 by anything in the game. ; where I want to do my stuff. EndEvent Because the quest in question is a vanilla one, for the sake of compatibility, I'd like to avoid directly editing its stage 60 fragment just to add my stuff. If it's not possible with events directly, then what would be the correct way to do this? How do I execute my script stuff when a quest is moved to a certain stage?
  13. Yes, works as expected now. Thanks for all your kind help :)
  14. Sounds like a good workaround and failsafe :) Thanks, will try soon.
  15. Sorry for the delay. (Other projects, loads of stuff to do and this had a sudden fallback on the priority list). Okay, I seem to have forgotten to change the Delivery key. I changed that to target actor, and now the Cast applies them properly. The timer is also there. However, it still stacks, instead of getting the timer refilled when recasing. I then tried to tick "No Recast" in the magic effects, which according to the documentation should help (No Recast: Once the magic effect is applied to a target, it cannot be cast again on the same target until it has worn off or been dispelled.). But it changed nothing. It still stacks when it's recast. :mellow:
  16. That sounds even better, because then it can be applied to multiple npcs at the same time. I tried it and it's applied, but I have the following problems: - It's not removed after 2 hours. 1) I first tried to set the duration in the spell's window to 2 h and I unticked the "no duration" checkbox in the magic effect.. It didn't work, it says there as an active effect. 2) I then tried this: GYHFollowerBoonSA.SetNthEffectDuration(0, 7200) to set the duration. No result, it just doesn't go away, it stays there as an active effect. - The effect can now be stacked which is not something I want. Instead if the player repeats the action that applies the effect, I'd like to just renew the duration to 2h again. (but not apply the effect again). This was easy with the alias/addSpell way, but is it possible with this cast method too?
  17. Okay, this is very, very weird. I tried it on another npc, and... it works. Applied properly, health value changed correctly. :huh: (So it doesn't work for npc1, but after that now the alias has been set then to npc2, and it works.) Extra weird part: If I now go back now to npc1 (clears alias of npc2 and set it to npc1 once again) - then now it works on npc1 as well! Baffling. I'm guessing that the alias has a hard time getting activated on that one npc when it's filled for the first time.... or I don't know.... or it's just Skyrim being.... Skyrim. :dry: I'll try the AddSpell way tomorrow, but I'll have to solve the problem that the actor info is not at hand for the script. I was thinking something like Actor AffectedActor function TheActualApplierFunction(Actor akTarget) ; here: stuff from previous posts to add the spell to akTarget ;save actor info: AffectedActor = akTarget ; removing is done after 2 hours. UnRegisterForUpdateGameTime() RegisterForSingleUpdateGameTime(2) endfunction Event OnUpdateGameTime() ; previously this just cleared the alias, now instead here is how the actor will be available: AffectedActor.RemoveSpell( the spell) EndEvent So I'm effectively just substituting the always available alias with an always available placeholder variable.
  18. It's an ability. :/ Here's the spell: Maybe I should set magnitude here as well? I'd really like to avoid a direct modav, just to err on the side of compatibility.
  19. I'm sure that's what I did :D (The mod already uses quite a lot of skse calls, it's not introducing a new requirement either.) I just wanted to make removing the spell easier, that's why instead of "AddSpell", I force the npc to an alias that has this spell. Later to remove it is just to clear the alias, which the script always has on hand. (But the script may not have the actual npc at hand anymore at a later point, so RemoveSpell might be tricky). But the spell is there. It's applied to the npc for sure, I can see that in the console. That part's correct now. But it's not applying its effect for some reason, the health of the npc is not changed. And I don't yet see why.
  20. I see, thanks :smile: I wouldn't use a direct setav command either, that just sounds too hard to control. So I changed the magic effect to Value Modifier. I also added the line: HealthAbility.SetNthEffectMagnitude(0, (MyActor.GetBaseAv("Health") * 0.25)) However, to have better trackability, instead of AddSpell, I opted for an alias that loads the spell, and the script sets this alias to the actor. It seems to work. Now the spell is indeed added to the npc, it's visible in the console (mfg), and also if I expand, the magnitude seems correct. However, the npc's health is unchanged. As if the spell was doing nothing. I'll attach a screenshot of the magic effect in a sec. EDIT: here's the magic effect:
  21. Hello, It turns out I don't know how to apply an effect to NPCs. For example, I'd like to apply an effect that increases the npc's health by 25%. Here's what I did: 1) Set up a Perk, check playable box, set it to Modify Skill Use, multiply by 1.25. 2) Set up a Magic Effect. I used "Well Rested" as a template: - Peak Value modifyer as archtype - Constant Effect - Delivery: self - Assoc. item: Health - Perk to apply: Previously defined perk - Attached Timed Ability Script. TIme set to 2 hours, ability to remove set to spell in next point: 3) Set up a Spell Ability. - Type: Ability - Effects: The previously defined Magic Effect. Then, in the script where I want to apply this, I just write SPELL Property Spell_in_point3 Auto function ApplySpell(Actor akTarget) Spell_in_point3.Cast(akTarget,akTarget) Debug.Notification("Funcation ran fine.") ; I do get this report, so scripts run fine. endfunction But in-game, nothing happens, the effect is not applied to the npc. What am I doing wrong again?
  22. Ah, so that's just the refID :D Sorry, I was quite slow minded last night, should have called it a day earlier probably. Yes, it works now with this, thank you :)
  23. I'm not sure I understand the terminology. :sad: I checked out the formID from TES5Edit under: +Non Player Character (Actor) - > form ID Which is the other one? I only found: +Worldspace -> +Cell -> +Persistent -> Placed NPC, but this has the same formID.
  24. Hello, After solving the problems in my previous topics (thanks to the awesome people of these forums :smile: ), here's the next: Is it possible to set up a Quest Alias that's filled with an npc from another mod's esp? My aim is to be able to get an event when the player talks to this npc. So I figured I would create a quest alias, and attach this script to it: Scriptname ScriptOnQuestAlias extends ReferenceAlias Event OnActivate(ObjectReference akActionRef) if(akActionRef == Game.GetPlayer() ) ; do my stuff endif EndEvent The alias is set to forced, and none in the beginning. (Quest is start game enabled, "allow reserved" is greyed out). The filling of the alias is done by my other script that manages all of my mod's "related-to-other-mods" content (this is attached to a PlayerAlias in the same quest): ReferenceAlias Property NPCAlias Auto ; in the CK, properly set to the previously setup quest alias. ; other stuff ; in a function: if(Game.GetModByName("OtherMod.esp") != 255 ) Debug.Notification("Printout 1") Actor npc = Game.GetFormFromFile(0x000012c4, "OtherMod.esp") as Actor NPCAlias.ForceRefTo(npc ) Debug.Notification("Printout 2") endif My problem is: the alias doesn't get filled. I do get both debug messages, so the function works for sure, and the fill must be attempted. But the alias stays unfilled (says NONE in the console). I double, triple, then quadrupole-checked that I have the correct formID in the GetFormFromFile call, and it's indeed the npc's formID. What am I doing wrong here? :/
×
×
  • Create New...