Dlesang Posted April 3, 2014 Share Posted April 3, 2014 I'm working on a summon custom creature script. Right now I have a working script that moves an actor from two set points in the world, and it works even if the actor dies first (say during combat or something). But how do I inform the script to place the actor near the player's location to allow the spell to work like the hard-coded Summon Creature spells? I'm having trouble tracking down any means of finding a "get player location" function. Link to comment Share on other sites More sharing options...
QQuix Posted April 3, 2014 Share Posted April 3, 2014 YourActorReferenceID.MoveTo PlayerRef 100 0 0 will place the actor 100 units north of the player (adjust the "100 0 0" for other relative positions) Link to comment Share on other sites More sharing options...
Dlesang Posted April 5, 2014 Author Share Posted April 5, 2014 (edited) The result is inconsistent. It seems to work about 90% of the time when in an external cell. However, it works only about 10% of the time when summoning the actor from another cell into the internal cell you're in. I run around an internal spell, casting the spell over and over again, trying to get my actor to appear inside. I've managed to make it happen only once. If they're in the same cell you are, it seems to work well. Otherwise, they seem stuck outside, unable to reach you until you go outside and cast the summon again. In the end, I'd program the actor with AI that'd allow them to simply follow you through doors. But first, I want to create a spell that reliably pulls the Actor into your cell on command. At the end of this spell, they're wisked away to a special "holding" cell until they're called again. This is the closest work-around to the hard-coded Summon Creature spells I can think of. MAN, why didn't Bethesda just include a "summon custom creature" slot in their spell effects selection menu? It would have made this SO easy. Edited April 5, 2014 by Dlesang Link to comment Share on other sites More sharing options...
QQuix Posted April 5, 2014 Share Posted April 5, 2014 It may be that MoveTo is moving the actor to a point in the void outside the interior walls. The following function moves something to a place in front of an actor (requires OBSE) "YourActorReferenceID.call zuRefPositionInFront PlayerRef 100" Will move the actor to a point 100 units in front of the player, no matter where the player is facing (make sure the player has some clear space in front) scn zuRefPositionInFront ;-------------------------------------------------------- ; ; zuRefPositionInFront ; '08/set/2012 15:32 ;-------------------------------------------------------- ; ; Positions a ref x units in front of an actor ; ;-------------------------------------------------------- float ang float angZ float dis float posX float posY ref refMark begin Function {refMark dis} Let angZ := refMark.GetAngle Z if angZ <= 90 Let ang := 90.0 - angZ else Let ang := 450.0 - angZ endif Let posX := refMark.GetPos X + dis * Cos ang Let posY := refMark.GetPos Y + dis * Sin ang MoveTo refMark SetPos X posX SetPos Y posY SetAngle Z angZ end Link to comment Share on other sites More sharing options...
Recommended Posts