Jump to content

What did do wrong?


Cyde042

Recommended Posts

 This errors are like ping pong, what am I supposed to do?

function farmplotpostinit(inst)	oldGrower = inst.components.grower:RemoveCrop(crop)	    inst.components.grower:RemoveCrop(crop) = function(inst) --it wants a function argument near =, but when I add it - "(crop)", it says unexpected symbol near =		if GLOBAL.GetPlayer():HasTag("winnie") then 		    GLOBAL.GetPlayer().components.sanity:DoDelta(TUNING.SANITY_MED)   		end	    endend
Link to comment
Share on other sites

 

 This errors are like ping pong, what am I supposed to do?

function farmplotpostinit(inst)	oldGrower = inst.components.grower:RemoveCrop(crop)	    inst.components.grower:RemoveCrop(crop) = function(inst) --it wants a function argument near =, but when I add it - "(crop)", it says unexpected symbol near =		if GLOBAL.GetPlayer():HasTag("winnie") then 		    GLOBAL.GetPlayer().components.sanity:DoDelta(TUNING.SANITY_MED)   		end	    endend

 

You want to add sanity bonus when she harvest crops?

 

Link to comment
Share on other sites

function GrowerComponentPostInit(inst)inst.RemoveCrop = function(self ,crop)    crop:Remove()    self.crops[crop] = nil	if GLOBAL.GetPlayer():HasTag("player") then            GLOBAL.GetPlayer().components.sanity:DoDelta(TUNING.SANITY_MED)      end    for k,v in pairs(self.crops) do        return     end        self.isempty = true    self.inst:RemoveTag("NOCLICK")    self.cycles_left = self.cycles_left - 1    	if self.setfertility then		self.setfertility(self.inst, self:GetFertilePercent())	endendendAddComponentPostInit("grower", GrowerComponentPostInit)

Just change "player" to "winnie"

Link to comment
Share on other sites

function GrowerComponentPostInit(inst)inst.RemoveCrop = function(self ,crop)    crop:Remove()    self.crops[crop] = nil	if GLOBAL.GetPlayer():HasTag("player") then            GLOBAL.GetPlayer().components.sanity:DoDelta(TUNING.SANITY_MED)      end    for k,v in pairs(self.crops) do        return     end        self.isempty = true    self.inst:RemoveTag("NOCLICK")    self.cycles_left = self.cycles_left - 1    	if self.setfertility then		self.setfertility(self.inst, self:GetFertilePercent())	endendendAddComponentPostInit("grower", GrowerComponentPostInit)

Just change "player" to "winnie"

 

 

Did really want to replace the function but I can't get the thing to work, guess I'll have to use it. Thanks.

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...