Feralkyn Posted December 30, 2018 Share Posted December 30, 2018 (edited) So, I've a quest that does the following:- Player gets spell- Player finds Falmer NPC in world, fires spell at them, they vanish (Banish spell)- Falmer NPC is then "translocated" to jail cell within another cell (in actuality, the game spawns an NPC at an X-marker in the cell, with a new race--MODNAMEFalmerRace I have all of this working fine. Now, what I'd like to do is have either an AoE spell, which can be fired from an -object- (I made an AoE banish spell targetting only my race, but can't seem to figure out how to make it fire from an object or even player when a lever's pulled), OR a simple quest stage update (very much preferred, so the player doesn't accidentally wipe out existing Falmer that are -meant- to be there), which will disable all instances of the race. It could be limited to just this cell, since they aren't meant to leave it. I -could- make it a unique alias in the first place and so on but I need a failsafe to ensure that should the mob somehow get out of his cell, or die, or should one fail to despawn or should more somehow get spawned (in other words if there's ANY errors), I still have a way for the player to reset the scenario with an in-game mechanic (a lever) which would both reset quest status and disable any and all Falmer (of this modded race), whether they're living or dead, already present. SEE SOLUTIONS a few posts below. I'm also looking for a way, on a sidenote, to do the following: - Actually talk to the Falmer; unfortunately even with a dialogue option present with voicetype set to the Falmer one (which the new race's NPC uses) and even with the script to allow PC dialogue, it doesn't seem to fire- A way to spawn a single, random NPC, when triggered, from a list of NPCs, at a specific spot Any help with any of these three things is appreciated. This particular mod I'm working on is a big, complex PITA but I think it'll be worth it. I hope. Maybe. Edited January 3, 2019 by Feralkyn Link to comment Share on other sites More sharing options...
Feralkyn Posted January 2, 2019 Author Share Posted January 2, 2019 (edited) New question, in addition to the others: Is there any script command or AI package to disallow NPC sneaking? It has to be togglable via AI packages/dialogue scripts/factions/whatever. Likewise, is there a way to set an NPC as "teammate" (not follower) in Creation Kit, instead of via scripts? Edited January 2, 2019 by Feralkyn Link to comment Share on other sites More sharing options...
Feralkyn Posted January 2, 2019 Author Share Posted January 2, 2019 (edited) As per point 1 I've been trying to use a lever to enable an invisible NPC, which then would cast a cloak banish spell, or an AoE spell. I have gotten that far, but the banish doesn't actually do anything. I've tried a large number of variations for the last several hours in terms of spell effects, targets and so on. The ONLY way to do it seems to be a cloak/AoE--setting the invisible NPC's AI package to cast magic or cast repeated spells does not allow it to find its own target, and instead requires a reference. Unfortunately I can't figure out if there's a way to do "splash" Banishes. It's a shame, because I could easily use my existing & functioning falmer banish spell IF I could figure out a way for either an object (preferable) or invisible npc to target them. Also: I had the Falmer talking, and then it stopped, and I cannot for the life of me figure out why. I created 3 pieces of test dialogue with varying conditionals--race, race + inventory piece, race + inventory piece + quest stage (this third was working prior). Test dialogue allows it to respond with a dialogue conditional of race, THOUGH it doesn't actually give a correct response; but the conditional of quest objective doesn't pass despite a getstage showing the correct stage, as well as a piece of inventory conditional not registering. I've tried varying the AI packages to no avail. All these tests are no mods/fresh saves/seq generated + saved/restarted, with optional aliases on the relevant quests, if any. I'm baffled. Sometimes, too, one of the relevant quests doesn't start--despite being start game enabled, SEQ'd & saved/reloaded. Again, baffling. ...edit, now the dialogue's working again. And appearing twice. Edited January 3, 2019 by Feralkyn Link to comment Share on other sites More sharing options...
Feralkyn Posted January 3, 2019 Author Share Posted January 3, 2019 (edited) Further update, I've tried going the other way and attaching a script directly to the base Actors in question. The idea was to try and call an onActivate to a linked lever but it instead disables them when I try to speak to (activate) them, instead, despite the property being filled with a lever--I guess it's just the way the event works. Any help still appreciated, tearing my hair out here. :mellow: SOLUTION - I've added an AI package to the base Actor. Any package template will work--I just used one that has him stay in the same place. What matters is the condition & the OnBegin scripts. This AI package requires, as a condition, the Quest in question to be at stage X. The AI package includes, "on begin," a script to Disable(true) and then to Disintegrate (to avoid invisible savegame bloat hanging about). The simple script fragment, attached to the actor's "on begin" in the AI package: akactor.disable(true) Utility.Wait(5.0) akActor.SetCriticalStage(akActor.CritStage_DisintegrateEnd)Hopefully this helps someone in the future. It won't be precisely-timed but it's the best I can figure. For a specific cell, the cell can be added to AI package conditions, you'd just need a quest or something to progress stage -> enable AI package. Now I need to figure out how to keep an NPC as a Teammate permanently (not follower) & how to disable Sneaking for the duration, so they don't get nekkid once unloaded. Edited January 3, 2019 by Feralkyn Link to comment Share on other sites More sharing options...
ReDragon2013 Posted January 3, 2019 Share Posted January 3, 2019 (edited) You will probably need three scripts. Keep in mind that is a suggestion, mabye there is an easier way to solve your problem. Samples as follow: xyzQuestScript Scriptname xyzQuestScript extends Quest ; has a formlist to hold all falmer actors which shares the parentcell with the player ;Spell PROPERTY banishSpell auto ; the spell to banish the falmer FormList PROPERTY myList auto Hidden ; -- EVENT -- EVENT OnInit() Debug.Trace(self+" OnInit() - is running now..") ENDEVENT ; -- FUNCTIONs -- 3 FUNCTION myF_AddFalmer(Actor aRef) ;--------------------------------- myList.Add(aRef) ; fill list with loaded falmer, if actor already here it will not add another ENDFUNCTION FUNCTION myF_RemoveFalmer(Actor aRef) ;------------------------------------ myList.Remove(aRef) ; remove an unloaded falmer from formlist ENDFUNCTION FUNCTION myF_HideFalmers() ;------------------------- int iMax = myList.GetCount() int i = 0 WHILE (i < iMax) actor aRef = myList.GetAt(i) as Actor xyzFalmerActorScript ps = aRef as xyzFalmerActorScript IF ( ps ) ps.gotoState("Busy") aRef.DisableNoWait() ; disable the falmer ;;; banishSpell.Cast(aRef as ObjectReference) ; or use a spell to banish ps.gotoState("") ENDIF i = i + 1 ENDWHILE ENDFUNCTION xyzLeverScript Scriptname xyzLeverScript extends ObjectReference ; is the trigger to make currently loaded falmers invisible Quest PROPERTY myQuest auto ; fill with quest from above, new created with CK ; -- EVENT -- EVENT OnActivate(ObjectReference akActionRef) IF (akActionRef == Game.GetPlayer() as ObjectReference) (myQuest as xyzQuestScript).myF_HideFalmers() ENDIF ENDEVENT EVENT OnTriggerEnter(ObjectReference triggerRef) ; same code as activate, but to handle a triggerbox ENDEVENT xyzFalmerActorScript Scriptname xyzFalmerActorScript extends Actor ; should be attached to each baseobject of falmer Quest PROPERTY myQuest auto ; fill with quest from above, new created with CK Bool bLoaded = False ; track actor disable/enable ; -- EVENTs -- 2 + "Busy" EVENT OnCellLoad() Debug.Trace("OnCellLoad() - "+self) ; info only IF self.IsDisabled() ; do nothing already disabled by game or other mod ELSE bLoaded = TRUE (myQuest as xyzQuestScript).myF_AddFalmer(self) ENDIF ENDEVENT EVENT OnUnLoad() IF ( bLoaded ) bLoaded = False (myQuest as xyzQuestScript).myF_RemoveFalmer(self) IF self.IsDisabled() self.EnableNoWait() ENDIF Debug.Trace("OnUnLoad(1) - "+self) ; info only ELSE Debug.Trace("OnUnLoad(0) - "+self) ; info only ENDIF ENDEVENT ;========================= state Busy ; cover event in no state, while quest script wants to disable the falmer ;========= EVENT OnUnLoad() ;; Debug.Trace("OnUnLoad() - "+self) ; info only ENDEVENT ;======= endState Edited January 3, 2019 by ReDragon2013 Link to comment Share on other sites More sharing options...
Feralkyn Posted January 3, 2019 Author Share Posted January 3, 2019 (edited) Ahh man that's also genius. If the timing of this one turns out to be too iffy I will definitely give that a shot, thanks so much. I hadn't even considered filling lists etc on cell load, as I've been testing from within the cell--but of course the player won't be. That code is also absolutely gorgeous and so far beyond me :laugh: Edited January 3, 2019 by Feralkyn Link to comment Share on other sites More sharing options...
Feralkyn Posted January 3, 2019 Author Share Posted January 3, 2019 (edited) My other issues are a continuing saga. My dialogue specifically with the Falmer works, but rarely, and with no rhyme or reason that I can tell. Worse still, sometimes it duplicates, or even triplicates, so that I see the same dialogue option 2-3 times on the same NPC at once. Update--fixed it. I removed the dialogue in question, put it into a new quest and removed all apostrophes. I'm not sure which part fixed it but both of the dialogue options with errors were a. the only options in Quest X and b. the only ones with apostrophes, so maybe the quest was somehow borked, or the apostrophes screwed it up somehow. Edited January 3, 2019 by Feralkyn Link to comment Share on other sites More sharing options...
Recommended Posts