Page 1 of 1

Stone Buddy error breaking game

Posted: Fri May 29, 2015 3:24 am
by xnd
code from:

newTalent{
name = "Stone Golem",

copied from wild-gift/summon-melee

without changing it (name changed of course).

AND I added in the class code the same code that wilder summoners have:

getStatDesc = function(stat, actor)
if stat == actor.STAT_CUN then
return "Max summons: "..math.floor(actor:getCun()/10)
end
end,

BUT it still breaks the game completely as soon as the level loads, and it fills the log with like 40 pages of:

Lua Error: /data-Chrono_Xorn/talents/Chrono_Xorn.lua:1807: attempt to call global 'checkMaxSummon' (a nil value)
At [C]:-1 checkMaxSummon
At /data-Chrono_Xorn/talents/Chrono_Xorn.lua:1807 on_pre_use
At /mod/addons/verdant/superload/mod/class/Actor.lua:424 preUseTalent
At /engine/HotkeysIconsDisplay.lua:174 display
At /engine/HotkeysIconsDisplay.lua:264 toScreen
At /mod/class/uiset/Minimalist.lua:1920 displayHotkeys
At /mod/class/uiset/Minimalist.lua:2154 display
At /mod/class/Game.lua:1562
Lua Error: /data-Chrono_Xorn/talents/Chrono_Xorn.lua:1807: attempt to call global 'checkMaxSummon' (a nil value)
At [C]:-1 checkMaxSummon
At /data-Chrono_Xorn/talents/Chrono_Xorn.lua:1807 on_pre_use
At /mod/addons/verdant/superload/mod/class/Actor.lua:424 preUseTalent
At /engine/HotkeysIconsDisplay.lua:174 display
At /engine/HotkeysIconsDisplay.lua:264 toScreen
At /mod/class/uiset/Minimalist.lua:1920 displayHotkeys
At /mod/class/uiset/Minimalist.lua:2154 display
At /mod/class/Game.lua:1562
Lua Error: /data-Chrono_Xorn/talents/Chrono_Xorn.lua:1807: attempt to call global 'checkMaxSummon' (a nil value)
At [C]:-1 checkMaxSummon
At /data-Chrono_Xorn/talents/Chrono_Xorn.lua:1807 on_pre_use
At /mod/addons/verdant/superload/mod/class/Actor.lua:424 preUseTalent
At /engine/HotkeysIconsDisplay.lua:174 display
At /engine/HotkeysIconsDisplay.lua:264 toScreen
At /mod/class/uiset/Minimalist.lua:1920 displayHotkeys
At /mod/class/uiset/Minimalist.lua:2154 display
At /mod/class/Game.lua:1562


The line causing the error is the checkmaxsummon from

on_pre_use = function(self, t, silent)
if not self:canBe("summon") and not silent then game.logPlayer(self, "You cannot summon; you are suppressed!") return end
return not checkMaxSummon(self, silent)
end,


So, if the talent is copied, and the code from the class that uses it is copied, what else do I need to do?

Re: Stone Buddy error breaking game

Posted: Fri May 29, 2015 5:07 am
by HousePet
The checkMaxSummon function from wilder.lua?

Re: Stone Buddy error breaking game

Posted: Fri May 29, 2015 5:32 am
by xnd
?
yes wilder.lua is where this is from.

getStatDesc = function(stat, actor)
if stat == actor.STAT_CUN then
return "Max summons: "..math.floor(actor:getCun()/10)
end
end,


i dont see another function there, except a locked and a particles.

Re: Stone Buddy error breaking game

Posted: Fri May 29, 2015 9:56 am
by HousePet
Oops, I meant gifts.lua.

Re: Stone Buddy error breaking game

Posted: Sat May 30, 2015 1:46 am
by xnd
ah thanks, so it was hidden over there, ok.

seems to work. but probably best to make it summon like the time hounds instead. golem wimp dies in a couple hits on ID 1.