-
Posts
11 -
Joined
-
Last visited
Everything posted by xyz3lt
-
[LE] Switch Between AI Packages too slow
xyz3lt replied to Deleted56253002User's topic in Skyrim's Creation Kit and Modders
Maybe this is what you were looking for? You can also do something like Soldier1.SheatheWeapon() Soldier1.EvaluatePackage() To make sure the sheathe weapon as soon as possible. Altough if you want to run more than one function on any actor use an array. I am new to papyrus but if i understand correctly Actor arrays aren't native and you have to use PapyrusUtil.ActorArray(int length), i am not sure tho. Actor[] Soldiers = PapyrusUtil.ActorArray(16) Soldiers[0] = Soldier1 ;All soldiers can have an actor script that does plotting automatically but thats a bit harder to do ;... 1-14 soldiers here Soldier[15] = Soldier16 ;to run functions on them do a loop int i While i < Soldiers.Length Soldiers[i].SheathWeapon() Soldiers[i].EvaluatePackage() i+=1 endWhile Anyways i am not exactly qualified to give you advice. -
[LE] How to scan for actors around player?
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
For now i'll try to improve SpellScanner, implement proper FindAllReferencesWithKeyword search keyword being ActorTypeNPC, implement skypal Grid() then filter it for actors then distance, and finally GetActorsByProcessingLevel with a bit of postprocessing, also using skypal filter for distance. Then test for performace impact of those 4 methods and that would be it. Thanks for all the help thats probably all i needed to know. -
[LE] How to scan for actors around player?
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
Test script i am using. elt_QuestScanner.psc: Test62 FindAllReferencesOfFormType works erratically detecting invisible things and sometimes nothing. Test64 using my spell scanner, works fine, but it does take 5 seconds (i could probably cut it down a bit). Test65 FindAllReferencesOfType doesn't ever return anything, clearly i am using it wrong and after a bit of testing i still don't have any idea how to make it return anything. Test66 GetActorsByProcessingLevel, it does work, returns 50 actors on average, with a bit of processing it coud easily be cut down to ~15, any idea how does it perform in comparison to spell? As for keywords search i didn't try it yet, i am not sure what keyword to look for, i could make a script cloak that adds/removes keywords but that couldn't possibly be performance friendly. Edit: As for MiscUtils ScanCellNPCs it only scans around you in current cell, works great for interiors but no so much for worldspace (square grid of cells). Edit2: somewhat more readable script -
[LE] How to scan for actors around player?
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
Big problem with GetNthRef / GetNumRefs is how cells work, inside a big cell like a ruin you can get a lot of hits, but add some GetDistance processing and you are good, meanwhile actors standing next to you inside worldspace like tamriel or whiterun may not be detected since they are technically in a different cell. For interiors i could just use ScanCellNPCs from MiscUtils as it does have built in distance, but for exteriors i'd have to check roughly 4 cells closest to player to get rid of "standing next to but not detected" issue. If it's faster then spell approach i'll try doing it anyways. As for PO3 it just acts strangely, maybe i misunderstood how it works, using script above, outside of jorrvaskr i can get at most 3 detections (player included) but usually 0 not even player, but inside even though there were only 2 npcs there i got 13 detections, including strange things like bandits and silver hand. -
Naturally since i am looking for a way to get actors from around player any way of scanning for ObjectRefrences around some ObjectReference will do. Ideally what i'd like is a Scan() function that returns array of Actors or ObjectReferences. Roughly what i am using right now. elt_Scanner.psc: elt_ScannerEffect.psc: Script above casts AOE on player and retrives actors this way, but it does take a little while, mostly because i don't know how to safely handle parallelism differently. I tried to use PapyrusUtils>MiscUtils>ScanCellNPCs but exactly as it says it only seems to scan a single cell, which is a problem in worldspace since cells are divided into squares. Also thought of getting 4 closest cells to player then GetNthForm for actors and handle distance manually with GetDistance. I didn't try it though. And also tried PowersOfThree>PO3_SKSEfunctions>FindAllReferencesOfFormType but that function seems to returns references as you would see them in CK render window. It worked very oddly, sometimes returning nothing and sometimes a lot. Some mod that i checked made use of a scriptCloak that add's keywords, then Actors are retrived trough ReferenceAlias'es. It's a bit too confusing for me to recreate from just looking. Here is PO3 script incase i used it incorrectly. elt_QuestScanner.psc:
-
[LE] Getting conditional variables, and classes
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
I use factions already, but i first i have to get booleans out of them(2 factions with ints, 2 factions carrying 14 flags. sseedit indicates they are 8 bit, 14 factions to do that would be an overkill). Quote from creation kit reference page about GetInFaction. No way i can & my flags out of a faction without a script. there is also GetFactionRank but it can only be compared with standard operators (> < != == <= >=). So unless i am willing to add 16 factions on hundreds of actors it doesn't work. Also since i would be essentially just putting bools on actors, i might as well use keywords for that. Maybe what you meant is that i should infact make all those factions/keywords add them to actor and onEffectDispell(or whatever end of Magic effect event was called) remove them. I get a feeling i am just overclompicating this, since it seems to work, i'll just go along with my quest idea, i do appreciate all the help though. -
[LE] Getting conditional variables, and classes
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
I want to use conditions for scene and player dialogs, currently i am using AOE that does addSpell() that adds Abilty with ActiveMagicEffect(it does have some basic conditions such as IsInCombat) to retrive all. On side note i'll probably ditch this model and use ScanCellNPCs from PapyrusUtils Let me elaborate, if i had a bool in a quest, where both quest and said bool are marked as conditional i could use it in conditional system with GetVMQuestVariable. If i had a bool in an activator, both marked as conditional, i could use GetVMScriptVariable on activator reference(a leaver in some cell for example). But if i were to "attach" ActiveMagicEffect onto some actor and then retrive it into the mainScript(with a callback or a while loop) then i would have "ActiveMagicEffect Property someEffect Auto" inside for example MainScript, i can use it's variables and functions just fine but i can't seem to get it to work with conditional system. If ActiveMagicEffect carries a bool i would have to make a new bool in MainScript just so i could retrive it with GetVMQuestVariable. Can you recommend me any mods that seem add dynamic npc scenes/dialog (or mods that rely heavily on scripted conditions, but thats a bit of an unreasonable request)? If i am lucky i might find what i am looking for by looking through their source/esp's. -
[LE] Getting conditional variables, and classes
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
Every actor reference i am operating on is scanned from player surroundings(Most of them will be vanilla), then put in ExtendedActor which after initializing stores variables extracted from factions and serves as an argument for few functions that operate on said variables(and sometimes on akRef). Dynamically attaching scripts to actors can be easilydone with ActiveMagicEffect or ActorAlias, thats not really the problem i have. All i really need is to get variables from dynamically attached scripts into conditional system in CK. And frankly, i have no idea how to do it, for now i'll just make a quest instance for all actors i need(2 for now but it will go up), put a simple script with variables in each of them and link them into mainScript as Properties. I already tested if it'll work, and it does, but it really feels like there is some better way of doing that. -
[LE] Getting conditional variables, and classes
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
Now that i read through your post a bit more throughly doing scriptname Actor extends ActorExtender would propably work pretty well (altough i am not sure if i could access it's variables in conditional) Below rough sketch of what i am doing / want to do scriptname MainScript Conditional ExtendedActor A1 Conditional ;Simply adding conditional doesnt work ExtendedActor A2 Conditional Function Work() ;init actors A1.akRef = ScanForActor() InitializeEA(A1) A2.akRef = ScanForActor() InitializeEA(A2) ;run some logic int res = SomeLogic() ;start a scene based on res and internal variables of A1 & A2 (and potenially A1-A7) ;i dont know how to access A1.Something from CK conditional window endFunction Function InitializeEA(ExtendedActor A) ;sets all of Extended Actor variables actor Function ScanForActor() Function SomeLogic() -
[LE] Getting conditional variables, and classes
xyz3lt replied to xyz3lt's topic in Skyrim's Creation Kit and Modders
Since i don't think you can dynamically make and instance of ExtendedActor i scratched that idea. Thanks for reply but i already did that and it doesn't do what i want it to. I dont want to give ExtendedActor to any single instance. Rather "ExtendedActor A = someActor as ExtendedActor". ActiveMagicEffect applied with addSpell() does work perfectly with exception that i cant use TESV conditional system with it. (no way of using GetVMQuestVariable or GetVMScriptVariable since there are no static references) And since conditional system doesn't seem to interact with reference aliases at all that idea was abandoned aswell. Currently i am begining to think i'll have to use the dirty quest hack that i mention in post above. All of the variables will be stored on actor as factions(4 factions total i think), then i'll get booleans and stuff from those. I need to make a class that holds actor reference, and all of the extracted variables, as to why code below should show it pretty well. bool Function Process(EA A1, EA A2) ;EA = ExtendedActor (not necesarilly extends Actor) dynamic if A1.bA && A2.bB == 1 ;just one function for 2 potential inputs if A1.bB == 1 ;bA and bB are some booleans return true ;problem is i cant access A1.bA from conditional system endif endif return false endFunction bool Function Process1() ;no actor extension here if baA1 && bbA2 == 1 ;but all vars are accessible from conditional system GetVMQuestVariable if bbA1 == 1 return true endif endif return false endFunction bool Function Process2() ;copy of Process1() that does the opposite if baA2 && bbA1 == 1 ;i dont even want to think about 3 or 4 actors. if bbA2 == 1 return true endif endif return false endFunction Also usage of global variables is out of question since i might end up with upwards of 100 booleans On the side note how does GetVMQuestVariable / GetVMScriptVariable compare to global variables and what is permormance cost on usage of those in general. -
Hello, am new to papyrus and i am looking for a way to store additional variables on Actor. Initially i tried to extend Actor and store my variables this way, that didn't work out because you cant cast Actor as ExtendedActor if there is no instance of ExtendedActor. Then i tried to addSpell(Actor) and retrive effects's 'self' with a callback, this worked pretty well until now, but i have no idea how to retrive effect's variables in conditional system, my guess is you can't do it without declaring additional variables in Main script. (exactly what i am trying to avoid by putting variables in ActiveMagicEffect) So i scraped that aswell. I tried to extend ReferenceAlias as conditional and retrive it with GetVMScriptVariable but after ticking use aliases and selecting alias with attached script conditional variables don't show up. GetVMScriptVariable did work with script attached to random world actor, does it simply not work with aliases? Anyways can i somehow declare a class to store actor together with additional variables, in a way that lets me use said variables in conditional system? I am pretty sure that making a new quest end attaching a simple script filled with variables would work, then just set in Main as property, but i'd have to do it for every actor i am going to use concurrently, (max 7) but it looks like a horrible idea so i want to avoid doing that.
