There are plenty of things you can't do with hooks, as they are only called at specific points. In this case, you might use the hook "Entity:loadList" and check for the bone giant each time the hook is called, and then modify the giant if found. The drawback there is that it would run the check every time an entity list is loaded. You can't use the typical "ToME:load" hook as that's only called when the mod is loaded and the giant may not exist at that point.
With overloading you can make a copy of the npc file and just modify the handful of stats you want to change, but like you said, that would be less compatible. With superloading, you'd normally use "local _M = loadPrevious(...)" and then modify what you need to, but with the entire file being local, I don't think that will work in this case. You might try that and add a few lines at the end that modify the giant after it has been generated.
Nerf the Half Finished Bone Giant!
Moderator: Moderator
Re: Nerf the Half Finished Bone Giant!
Actually, I was using an Entity:loadList hook, based on some info I read in other threads.Marson wrote:There are plenty of things you can't do with hooks, as they are only called at specific points. In this case, you might use the hook "Entity:loadList" and check for the bone giant each time the hook is called, and then modify the giant if found. The drawback there is that it would run the check every time an entity list is loaded. You can't use the typical "ToME:load" hook as that's only called when the mod is loaded and the giant may not exist at that point.
For some reason, overriding some parameters of the entity works at that level while overriding others seems to have no effect on actors spawned from that entity definition.
Specifically, I believe I'd like to change level_range from {7, nil} to, say, {4, nil}. When I try this via the Entity:loadList hook, he still spawns as a level 7 boss, even though the in-game LUA debugger shows his level_range as containing {4, nil}.
It could be related to the fact that the half-finished bone giant entity data actually derives from a base bone giant entity definition.
I don't think superloading will work, because they're data files with nothing but top-level newEntity() calls. I ran into the same issue with my Escorts Enhanced mod, as I needed to change data defined via top-level newAI() calls.With overloading you can make a copy of the npc file and just modify the handful of stats you want to change, but like you said, that would be less compatible. With superloading, you'd normally use "local _M = loadPrevious(...)" and then modify what you need to, but with the entire file being local, I don't think that will work in this case. You might try that and add a few lines at the end that modify the giant after it has been generated.
How do I look up an entity after it has been defined via newEntity()?
Re: Nerf the Half Finished Bone Giant!
Give a look at the latest version of my Everything is Unique addon.
You might be able to convert it into your uses, since it both touches npc files, and searches for their level range.
You might be able to convert it into your uses, since it both touches npc files, and searches for their level range.
<mex> have you heard the good word about archmage?
<mex> I'm here to tell you about your lord and savior shalore archmage
<mex> have you repented your bulwark sins yet?
<mex> cornac shall inherit the Eyal
<mex> I'm here to tell you about your lord and savior shalore archmage
<mex> have you repented your bulwark sins yet?
<mex> cornac shall inherit the Eyal
Re: Nerf the Half Finished Bone Giant!
Overloading the npc file for the zone isn't a big deal in this situation.
My feedback meter decays into coding. Give me feedback and I make mods.
Re: Nerf the Half Finished Bone Giant!
Thanks. Skimmed over the code, but it wasn't immediately obvious how it might apply to my needs.StarKeep wrote:Give a look at the latest version of my Everything is Unique addon.
You might be able to convert it into your uses, since it both touches npc files, and searches for their level range.
You're probably right. I went ahead and did a quick overload and it accomplished what I wanted without any trouble (i.e. lower minimum level to 4 and dex to 20-something)HousePet wrote:Overloading the npc file for the zone isn't a big deal in this situation.
I only had time for a quick test tonight, so I won't be able to publish the addon until (at least) tomorrow night.