Nerf the Half Finished Bone Giant!

All new ideas for the upcoming releases of ToME 4.x.x should be discussed here

Moderator: Moderator

Message
Author
Marson
Uruivellas
Posts: 645
Joined: Thu Jan 16, 2014 4:56 am

Re: Nerf the Half Finished Bone Giant!

#16 Post by Marson »

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.

HunterZ
Cornac
Posts: 39
Joined: Fri Jan 11, 2013 5:24 am
Location: Seattle
Contact:

Re: Nerf the Half Finished Bone Giant!

#17 Post by HunterZ »

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.
Actually, I was using an Entity:loadList hook, based on some info I read in other threads.

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.
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.
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.

How do I look up an entity after it has been defined via newEntity()?

StarKeep
Uruivellas
Posts: 703
Joined: Sun Feb 03, 2013 12:29 am
Location: Turtlemire

Re: Nerf the Half Finished Bone Giant!

#18 Post by StarKeep »

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.
<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

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

Re: Nerf the Half Finished Bone Giant!

#19 Post by HousePet »

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.

HunterZ
Cornac
Posts: 39
Joined: Fri Jan 11, 2013 5:24 am
Location: Seattle
Contact:

Re: Nerf the Half Finished Bone Giant!

#20 Post by HunterZ »

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.
Thanks. Skimmed over the code, but it wasn't immediately obvious how it might apply to my needs.
HousePet wrote:Overloading the npc file for the zone isn't a big deal in this situation.
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)

I only had time for a quick test tonight, so I won't be able to publish the addon until (at least) tomorrow night.

HunterZ
Cornac
Posts: 39
Joined: Fri Jan 11, 2013 5:24 am
Location: Seattle
Contact:

Re: Nerf the Half Finished Bone Giant!

#21 Post by HunterZ »


Post Reply