neurothrall Posted April 21, 2023 Share Posted April 21, 2023 Hello, I was wondering if anyone can look at this code and tell me what I may be doing wrong The whole point of this mod is to make a portable planter by spawning an NPC that links up to the activator once the player unpacks it by crouching, I get a activator menu but the menu doesn't start up when I press "E", yet no menu Is showing or Planter NPC spawning, i'm using custom planterforms Scriptname BreakingSkyrimPlanterSoilScript extends ObjectReference import debugimport utilityObjectReference Property PlanterContainer auto hiddenObjectReference property objSelf auto hiddenBool Property AlreadyLoaded = FALSE Auto Hiddenint property clearPlanterChoice auto hiddenmessage property planterClearMessage autoActorBase property BreakingSkyrimPlanterNPC Autobool doOnce = falseObjectReference Property BreakingSkyrimPlanterSpawn AutoFormList Property BreakingSkyrimNPCList AutoEVENT OnCellAttach() debug.trace(self + " OnCellAttach") if AlreadyLoaded == FALSE debug.trace(self + " OnCellAttach: DO ONCE") objSelf = self ;PlanterContainer = GetLinkedRef() (PlanterContainer as BreakingSkyrimPlanterContainerScript).mySoilRef = objSelf AlreadyLoaded = TRUE endif (PlanterContainer as BreakingSkyrimPlanterContainerScript).GrowPlantedItem()endEVENTEvent OnUnload() ;debug.notification("Object Has been unloaded") if PlanterContainer (PlanterContainer as BreakingSkyrimPlanterContainerScript).Check() EndIfEndEventauto state empty EVENT OnActivate(ObjectReference TriggerRef) if !doOnce objSelf = self PlanterContainer = BreakingSkyrimPlanterSpawn.PlaceActorAtMe(BreakingSkyrimPlanterNPC) BreakingSkyrimNPCList.AddForm(PlanterContainer) (PlanterContainer as BreakingSkyrimPlanterContainerScript).mySoilRef = objSelf (PlanterContainer as BreakingSkyrimPlanterContainerScript).GrowPlantedItem() doOnce = true EndIf debug.trace(self + " OnActivate") ; temp actor containerActor = PlanterContainer as actor if containerActor debug.trace(self + " ShowGiftMenu using filter = " + BreakingSkyrimPlanterCanegrassItem) containerActor.ShowGiftMenu(abGivingGift = true, apFilterList = BreakingSkyrimPlanterCanegrassItem, abShowStolenItems = true, abUseFavorPoints = false) else PlanterContainer.Activate(Game.GetPlayer(), FALSE) endif endEVENT endStatestate planted EVENT OnActivate(ObjectReference TriggerRef) IF triggerRef == game.getPlayer() clearPlanterChoice = planterClearMessage.show() if clearPlanterChoice == 1 (PlanterContainer as BreakingSkyrimPlanterContainerScript).plantedFloraRef.delete() (PlanterContainer as BreakingSkyrimPlanterContainerScript).plantedFloraRef = none (PlanterContainer as BreakingSkyrimPlanterContainerScript).plantedFloraBase = none BreakingSkyrimNPCList.RemoveAddedForm(PlanterContainer) PlanterContainer.Delete() doOnce = false ; back to "unplanted" state playAnimation("PlayAnim01") self.goToState("empty") PlanterContainer.Activate(Game.GetPlayer(), FALSE) endif endIf endEVENTendStateFormList Property BreakingSkyrimPlanterCanegrassItem auto Link to comment Share on other sites More sharing options...
Recommended Posts