How do I make it find this file to add monster?

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

How do I make it find this file to add monster?

#1 Post by xnd »

i made a monster

i saw another addon that altered a monster and i put my file in the same place:

\tome-Chrono_Xorn\overload\data\general\npcs

i even copied the entire original file and just added couple monsters so far.

this is temporal horrors to be summoned by the anomaly tear trap.

but the log says the file does not exist and no monsters come.

talent has this place that used to work:
local npcs = mod.class.NPC:loadList{" putstuffhere"}

what should put there to tell it where to get them?

and how do I add monsters and get it to find them in general, not just this talent?

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

Re: How do I make it find this file to add monster?

#2 Post by xnd »

isnt this supposed to add items to a list? i have this in the load.lua its not doing it



class:bindHook("Entity:loadList", function(self, data)
if data.file == "/data/general/npcs/horror_temporal.lua" then
self:loadList("/data-Chrono_Xorn/general/npcs/horror_temporal.lua")
end
end)


and i put the monsters in the file, even set rarity 1 to try to get them.

i managed to get no error message but no added monsters either. i tried a bunch of different things full of errors so how do i add new monsters or new items?

i either figure the tear anomally would have a rare chance of some exotic powerful monsters or it would pick an instigator of the tear like a Temporal Defiler or Chronolith or something from a list of some options, but i cant get the game to pay any attention to the monster file i made so how do i do it?

Zizzo
Sher'Tul Godslayer
Posts: 2524
Joined: Thu Jan 23, 2003 8:13 pm
Location: A shallow water area south of Bree
Contact:

Re: How do I make it find this file to add monster?

#3 Post by Zizzo »

xnd wrote:class:bindHook("Entity:loadList", function(self, data)
if data.file == "/data/general/npcs/horror_temporal.lua" then
self:loadList("/data-Chrono_Xorn/general/npcs/horror_temporal.lua")
end
end)
That will load entities into a separate list, that will get discarded pretty much immediately. What you want is something like this:

Code: Select all

class:bindHook("Entity:loadList", function(self, data)
	if data.file == "/data/general/npcs/horror_temporal.lua" then
		self:loadList("/data-Chrono_Xorn/general/npcs/horror_temporal.lua", data.no_default, data.res, data.mod, data.loaded)
	end
end)
In particular, data.res is the list into which the "outer" invocation of Entity:loadList() is loading its entities; by passing it through to your "inner" invocation, you're telling it to load the entities from your file into the same list. (The other data.XXX fields are the arguments passed to the outer invocation of Entity:loadlist(), which you'll want to pass through to your inner invocation for consistency.)
"Blessed are the yeeks, for they shall inherit Arda..."

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

Re: How do I make it find this file to add monster?

#4 Post by xnd »

thanks, i will try this!

Post Reply