How to use SKSE functions in the Creation Kit?

Post » Mon Nov 19, 2012 6:19 pm

Trying to check if an plant is harvested using the .IsHarvested() SKSE function.
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
User avatar
marie breen
 
Posts: 3388
Joined: Thu Aug 03, 2006 4:50 am

Post » Mon Nov 19, 2012 3:32 pm

Are you sure the SKSE PCSs have overwritten the default PCSs? If so, that should compile.
User avatar
Tanya
 
Posts: 3358
Joined: Fri Feb 16, 2007 6:01 am

Post » Mon Nov 19, 2012 1:42 pm

Are you sure the SKSE PCSs have overwritten the default PCSs? If so, that should compile.
Yes, I installed the SK after SKSE, installing SKSE solved it.

It works nice for mushrooms, will problably use the Heartfire models as they are smaller and more fitting.

However it does not work for most plants who are tree type

flora property plantplant auto
works but that is just mushrooms and some other stuff.
tree property planttree auto
does not work even if plants are listed as type TREE.

I simply want an reference to the plant I want to place,

Plan is to do something similar as Heartfire, you add an ingredient and it grows to an plant who can be harvested, it regrows in three days even if you are present
However her you make the field yourself.
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm


Return to V - Skyrim