varx Posted April 4, 2016 Share Posted April 4, 2016 My mod, More Spawns Scripted, has an issue where cloned NPCs are scaling with the player. The function which creates the clones, self.PlaceActorAtMe(), takes an encounter zone as the third argument. I'm currently passing it "none" because I don't know how to get the encounter zone that the Actor is in, but pretty sure that passing in a proper encounter zone object will fix the level scaling, I looked through the functions in the Actor script and saw nothing germane. Does anyone know? Link to comment Share on other sites More sharing options...
varx Posted April 5, 2016 Author Share Posted April 5, 2016 (edited) Hey, perhaps this is a very obscure question and nobody knows the answer offhand. Does anyone know of somebody who might know the answer to this question? Is there a community resource that may help me find the answer myself? I'm new to modding. All I know about is the creation kit wiki and the only mention it makes about encounter zones is describing how to use them with the gui. The thing is, is since the function PlaceActorAtMe() takes an encounter zone as an argument it must be possible to get that object in a papyrus script. Something like Actor.GetCurrentEncounterZone() I would expect, but I looked through the actor script and nothing jumped out. Even if you don't know the answer, if you have any suggestions on how to find it, I'd appreciate that too. Edited April 5, 2016 by varx Link to comment Share on other sites More sharing options...
Reneer Posted April 5, 2016 Share Posted April 5, 2016 The function you are looking for is GetEncounterZone(), in the ObjectReference script. EncounterZone Function GetEncounterZone() native Link to comment Share on other sites More sharing options...
varx Posted April 5, 2016 Author Share Posted April 5, 2016 (edited) Thanks! Edited April 6, 2016 by varx Link to comment Share on other sites More sharing options...
TheTalkieToaster Posted April 6, 2016 Share Posted April 6, 2016 As Actor extends ObjectReference, an Actor has access to all its functions. You can just call MyActor.GetEncounterZone() and under the hood the compiler will think (MyActor as ObjectReference).GetEncounterZone(). The (X as Y) format is what you use for casting in other situations where it's relevant (e.g. (List.GetAt(0) as ObjectMod)). Link to comment Share on other sites More sharing options...
Recommended Posts