Jump to content

Making Portable planter troubleshooting


Recommended Posts

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 debug
import utility

ObjectReference Property PlanterContainer auto hidden
ObjectReference property objSelf auto hidden

Bool Property AlreadyLoaded = FALSE Auto Hidden
int property clearPlanterChoice auto hidden
message property planterClearMessage auto
ActorBase property BreakingSkyrimPlanterNPC Auto
bool doOnce = false
ObjectReference Property BreakingSkyrimPlanterSpawn Auto
FormList Property BreakingSkyrimNPCList Auto

EVENT 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()
endEVENT

Event OnUnload()
;debug.notification("Object Has been unloaded")
if PlanterContainer
(PlanterContainer as BreakingSkyrimPlanterContainerScript).Check()
EndIf
EndEvent

auto 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

endState


state 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
endEVENT



endState



FormList Property BreakingSkyrimPlanterCanegrassItem auto

 

 

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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