Jump to content

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
https://forums.kleientertainment.com/forums/topic/41563-what-did-do-wrong/
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?

 

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"

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.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...