Wooty Posted February 13, 2018 Share Posted February 13, 2018 (edited) I FIGURED OUT THE PROBLEM Hello everyone, I'm trying to place an actor near me but when I do so and make either an ActorBase or Actor property to setin the creation kit I cannot find my npcs that I have created, I can only find ones that I have not created. So does anyone know how to set my npc as an actor or actor base so I can use them in my scriptHere is the script for reference: Scriptname wtyTestScript extends ActiveMagicEffect {Just something I use to test stuff.} Import GameImport SpellImport ObjectReference ObjectReference Property PlayerREF AutoActor Property NPCToSummon Auto <- Here is where I am unable to set the npc to my npc in the creation kit;ActorBase Property NPCToSummon Auto <- and here int Property spellAmount AutoFloat Property OffsetX AutoFloat Property OffsetY AutoFloat Property OffsetZ AutoFloat Property RotationOffset Auto ObjectReference currentNPC Event OnEffectStart(Actor akTarget, Actor akCaster) int counter = 0 ;currentNPC = PlayerRef.PlaceAtMe(NPCToSummon)currentNPC = PlayerRef.PlaceActorAtMe(NPCToSummon) ;places NPC at an offset to the Player currentNPC.MoveTo(PlayerRef, OffsetX * Math.Sin(PlayerRef.GetAngleZ() + RotationOffset), OffsetY * Math.Cos(PlayerRef.GetAngleZ() + RotationOffset), OffsetZ) EndEvent Edited February 13, 2018 by Wooty Link to comment Share on other sites More sharing options...
Wooty Posted February 13, 2018 Author Share Posted February 13, 2018 I swear everytime I post something on here I immediately figure out the problem... This is after about an hour and a halfs worth of work too. Link to comment Share on other sites More sharing options...
Jebbalon Posted February 13, 2018 Share Posted February 13, 2018 So, to answer question even though you figured it out - In CK you have to fill the property on the magic effect the script is attached to.Correct? Also ....I've worked on OBIS for long time and also with TonyCubed2's Sands of Time mod - Spawning NPCs via script is integral to both mods.For OBIS it works really well to not use the PlaceActorAtMe(). Instead it uses PlaceAtMe() As Actor with the Initially Disabled set to true. Then use Enable() after that.So for your example it would look like this... CurrentNPC = PlayerRef.PlaceAtMe(NPCToSummon, 1, abInitiallyDisabled = True) As Actor CurrentNPC.MoveTo(PlayerRef, OffsetX * Math.Sin(PlayerRef.GetAngleZ() + RotationOffset), OffsetY * Math.Cos(PlayerRef.GetAngleZ() + RotationOffset), OffsetZ) CurrentNPC.Enable(True) ; with fade in Link to comment Share on other sites More sharing options...
Jebbalon Posted February 13, 2018 Share Posted February 13, 2018 PlayerRef should be Actor propertyNPCToSummon I think should be ActorBaseand CurrentNPC should be Actor also Link to comment Share on other sites More sharing options...
Recommended Posts