However
if (CurPlant.IsHarvested())
gives an error: IsHarvested is not a function or does not exist error message
Curplant is an objectreference property declared at the top.
ObjectReference property CurPlant Auto
I'm working on making an farming mod much like in Heartfire but where you can create the soil where you want and plant on it.
This is the proof of concept code, mainly to see if placing the plant on soil, getting harvest state with IsHarvested and reset the plant to grown state work.
Another problem, most plants are not Flora but Tree, even stuff like leek, but
Tree property treeplant auto
gives an error, anybody know the name?
Scriptname mmfarmingsoil2 extends ObjectReference Flora property plantplant autoObjectReference property CurPlant Autobool property DoOnce = false Autoint property plantstate=0 auto;0 not planted, 1 growing, 2 plant, 3 harvested.Event OnLoad()BlockActivation()EndEventEvent OnActivate ( ObjectReference akActionRef)if plantstate==2 if (CurPlant.IsHarvested()) Debug.Notification("harvested") plantstate=3 else Debug.Notification("not harvested") endifendifif (plantstate==1) CurPlant = Placeatme(plantplant ) Debug.Notification("grown") plantstate=2endifif (plantstate==0) plantstate=1 Debug.Notification("planted")endifEndEvent