Jump to content

how to make my character can eat meat monster without consequences


sitca2

Recommended Posts

There should be a specific setting in the Data\Scripts\Prefabs\Webber.lua (or whatever the specific .lua prefab is for Webber) that specifically makes that alteration. If it's not, try Data\Scripts\tuning.lua as it may be a variation of Wilson.

 

>If a modification can be done by modifying Wilson's stats/rates, it tends to be done through TUNING.LUA.

 

>If the modification becomes clumsy or absolutely requires extra code, it'll me made into a specific file with the extra stuff. Webber most likely comes under this.

 

I'd check for you but, alas, I'm at work. If no one else answers your question in absolution, I will when I get home in a few hours.

 

Best of luck!

Link to comment
Share on other sites

From the webber prefab:

 

    inst.components.eater.monsterimmune = true
 

Relevant code from the Eater component:

function Eater:DoFoodEffects(food)    if food:HasTag("monstermeat") then        if self.inst:HasTag("player") then            return not self.monsterimmune        else            return not self.strongstomach        end    else        return true    endendfunction Eater:Eat( food )    if self:CanEat(food) then		        if self.inst.components.health then			if (food.components.edible.healthvalue < 0 and self:DoFoodEffects(food) or food.components.edible.healthvalue > 0) and self.inst.components.health then				self.inst.components.health:DoDelta(food.components.edible:GetHealth(self.inst), nil, food.prefab)			end        end        if self.inst.components.hunger then            self.inst.components.hunger:DoDelta(food.components.edible:GetHunger(self.inst))        end                if (food.components.edible.sanityvalue < 0 and self:DoFoodEffects(food) or food.components.edible.sanityvalue > 0) and self.inst.components.sanity then			self.inst.components.sanity:DoDelta(food.components.edible:GetSanity(self.inst))        end                self.inst:PushEvent("oneat", {food = food})        if self.oneatfn then            self.oneatfn(self.inst, food)        end                if food.components.edible then            food.components.edible:OnEaten(self.inst)        end                if food.components.stackable and food.components.stackable.stacksize > 1 and not self.eatwholestack then            food.components.stackable:Get():Remove()        else            food:Remove()        end                self.lasteattime = GetTime()                self.inst:PushEvent("oneatsomething", {food = food})                return true    endend
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...