Jump to content

Get current encounter zone in papyrus script?


varx

Recommended Posts

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

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 by varx
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...