Stone Buddy error breaking game

A place to post your add ons and ideas for them

Moderator: Moderator

Post Reply
Message
Author
xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Stone Buddy error breaking game

#1 Post 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?

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Stone Buddy error breaking game

#2 Post by HousePet »

The checkMaxSummon function from wilder.lua?
My feedback meter decays into coding. Give me feedback and I make mods.

xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Re: Stone Buddy error breaking game

#3 Post 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.

HousePet
Perspiring Physicist
Posts: 6215
Joined: Sun Sep 09, 2012 7:43 am

Re: Stone Buddy error breaking game

#4 Post by HousePet »

Oops, I meant gifts.lua.
My feedback meter decays into coding. Give me feedback and I make mods.

xnd
Archmage
Posts: 307
Joined: Sat Mar 21, 2015 7:33 pm

Re: Stone Buddy error breaking game

#5 Post 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.

Post Reply