Jump to content

Special power help


kordhrufan

Recommended Posts

Hi I'm trying to code the special power based on sanity, this is I have so far, the problem is, the mod is disable when I try to run it.

 

local sanitychange(inst,data){
 if inst.components.sanity.current <= 50 then
  inst.components.combat.damagemultiplier = 1
 else
  inst.components.combat.damagemultiplier = 0.75
}
local fn = function(inst)
 
-- choose which sounds this character will play
inst.soundsname = "wendy"
 
-- Minimap icon
inst.MiniMapEntity:SetIcon( "sari.tex" )
 
-- Stats
inst.components.health:SetMaxHealth(150)
inst.components.hunger:SetMax(120)
inst.components.sanity:SetMax(100)
inst.components.combat.damagemultiplier = 0.75
inst.components.sanity.night_drain_mult = (TUNING.WILSON_SANITY_MULT / 2)
inst.components.sanity.neg_aura_mult = (TUNING.WILSON_SANITY_MULT / 2)
inst:ListenForEvent("SanityTsuki", sanitychange)
 
end
 
Link to comment
https://forums.kleientertainment.com/forums/topic/49323-special-power-help/
Share on other sites

Reset() returning

HttpClientWriteCallback (0x00472D64, 1, 1250, 0x06BCF8AC)

HttpClientWriteCallback READ 1250 (1250 total)

scripts/screens/mainscreen.lua(576,1) platform_motd table: 0B16FF40

scripts/mods.lua(304,1) unloading prefabs for mod MOD_Sariya Byakura

Collecting garbage...

lua_gc took 0.02 seconds

~SimLuaProxy()

lua_close took 0.01 seconds

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

Orphaned unnamed resource. This resource must have used Add( resource ) to insert itself into the manager. 

HttpClient::ClientThread::Main() complete

Shutting down

 

 

the problem is the "sanitychange"  

 

 

I manage to solve the problem, thank you anyways!

I change

 

 

 inst:ListenForEvent("SanityTsuki", sanitychange)

 

into

inst:AddComponent("SanityTsuki")inst.components.SanityTsuki:personality()

and creating the file "SanityTsuki" inside a component folder in scripts.

 

 

local SanityTsuki = Class(function(self,inst) self.inst = inst  end)

 

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...