Addon HELP please .....
Posted: Tue Sep 26, 2017 2:23 pm
I've been working on this addon for months and lots of it works but I am pulling my hair out trying to get my new version of the default projector to work.
The code seems right to me and I've studied other addons in detail, but for some reason, my damage_types.lua code for the default projector doesn't load
In desparation, I am posting my draft addon here, in the hope someone will be kind enough to work out what I am doing wrong.
This addon can't be used with many other addons by the way, so would need to be tested alone, but embers, orcs, possessors, and vault all loaded.
here is my load.lua:
here is my init.lua:
here is the start of my damage_types.lua:
Here is my folder structure:
\data
\data\damage_types.lua
\data\talents
\data\talents\chronomancy
\data\talents\chronomancy\flux.lua
\data\talents\chronomancy\temporal.combat/lua
\data\talents\cursed
\data\talents\cursed\force-of-will.lua
\data\talents\cursed\gestures.lua
\data\talents\steam
\data\talents\steam\butchery.lua
\hooks
\hooks\load.lua
\overload
\overload\mod
\overload\mod\class
\overload\mod\class\interface
\overload\mod\class\interface\Combat.lua
\superload
\superload\mod
\superload\mod\class
\superload\mod\class\Actor.lua
init.lua
Thanks in advance!!!!
The code seems right to me and I've studied other addons in detail, but for some reason, my damage_types.lua code for the default projector doesn't load

In desparation, I am posting my draft addon here, in the hope someone will be kind enough to work out what I am doing wrong.
This addon can't be used with many other addons by the way, so would need to be tested alone, but embers, orcs, possessors, and vault all loaded.
here is my load.lua:
Code: Select all
-- Verbose. This is the way to load a new damage_types.lua file
local DamageType = require "engine.DamageType"
local ActorTalents = require "engine.interface.ActorTalents"
_G.vb_indent = ""
class:bindHook("ToME:load", function(self, data)
DamageType:loadDefinition("/data-verbose/damage_types.lua")
ActorTalents:loadDefinition("/data-verbose/talents/steam/butchery.lua")
ActorTalents:loadDefinition("/data-verbose/talents/chronomancy/temporal-combat.lua")
ActorTalents:loadDefinition("/data-verbose/talents/chronomancy/flux.lua")
ActorTalents:loadDefinition("/data-verbose/talents/cursed/gestures.lua")
ActorTalents:loadDefinition("/data-verbose/talents/cursed/force-of-will.lua")
end)
Code: Select all
long_name = "Verbose"
short_name = "verbose"
for_module = "tome"
version = {1,5,5}
weight = 115 -- needs to be higher than Embers (= 10)
author = { 'jenx' }
homepage = "http://tome.te4.org/"
description = [[This addon inserts much more information in the log about damage reduction.]]
tags = {'info'}
hooks = true
overload = true
superload = true
data = true
Code: Select all
local print = print
if not config.settings.cheat then print = function() end end
-- The basic stuff used to damage a grid
setDefaultProjector(function(src, x, y, type, dam, state)
if not game.level.map:isBound(x, y) then return 0 end
print("BLAH BLAH BLAH") --v
sf = string.format --v
--local vb_indent_init = _G.vb_indent --v
--_G.vb_indent = _G.vb_indent.." "
...
\data
\data\damage_types.lua
\data\talents
\data\talents\chronomancy
\data\talents\chronomancy\flux.lua
\data\talents\chronomancy\temporal.combat/lua
\data\talents\cursed
\data\talents\cursed\force-of-will.lua
\data\talents\cursed\gestures.lua
\data\talents\steam
\data\talents\steam\butchery.lua
\hooks
\hooks\load.lua
\overload
\overload\mod
\overload\mod\class
\overload\mod\class\interface
\overload\mod\class\interface\Combat.lua
\superload
\superload\mod
\superload\mod\class
\superload\mod\class\Actor.lua
init.lua
Thanks in advance!!!!