tModLoader Prefixes for Enemies

Do you have any other mods active (I'm not saying that the problem lies there, it can also be a bug this mod produced, but it's never wrong to ask... right)?
I wonder how the 5 other mods I have affect prefixes but I'll disable them and see what happens.
 
I wonder how the 5 other mods I have affect prefixes but I'll disable them and see what happens.
Well, it's the display name of the NPC that is not showing up correctly, right? If another mod also has a GlobalNPC instance (which allows for stat changes for all NPCs, vanilla as wel as mod) that tries to modify the display name of NPCs... Although it's unlikely, it's worth checking out ;)
 
After a few minutes, without any other mod installed I saw a green slime with the Flametrail Prefix but his name is still "Green Slime"
2016-02-24_00001.jpg

Sorry for the screenshot size.
 
When this mod is used in multiplayer, each clientside player gets different modifiers for the same enemy. Is there a way for you to change this?
Also, some modifiers are WAY too OP on the first few nights. Could you make it to where the more difficult modifiers change after each boss kill pre-hardmode?
 
When this mod is used in multiplayer, each clientside player gets different modifiers for the same enemy. Is there a way for you to change this?
Also, some modifiers are WAY too OP on the first few nights. Could you make it to where the more difficult modifiers change after each boss kill pre-hardmode?
There is a way to fix this, by making it so only the server can modify the prefixes of the NPCs.
BUT a lot of the data is stored inside an NPCInfo class, which is not automatically synched over network. Push comes to shove: this mod will not work in multiplayer untill official server support is implemented in tModLoader.
 
Oh, yeah, also, the shadow flame ball thing goes through walls. Not as in the explosion goes through walls, but sometimes enemies can cast it and it spawns past fortifications.

Edit: Yeah, not only does the ball go through walls, but the explosion does too. Yikes.
 
Last edited:
Your Disappearing prefixes might be because of the negative npcids and how those particular npc are created.

Also, I have an idea for a prefix. I don't have a name, but basically if you damage him he will transform into a much stronger NPC. (use the npc.Transform(int newType) method.)
 
That's a pretty neat idea. Wouldn't it be scary if a skeleton in prehardmode suddenly transformed into a Rusty Armored Bones and destroyed you? :D
 
Your Disappearing prefixes might be because of the negative npcids and how those particular npc are created.

Also, I have an idea for a prefix. I don't have a name, but basically if you damage him he will transform into a much stronger NPC. (use the npc.Transform(int newType) method.)
Image EoC, turning into the BoC.

I would love to see a Slime turn into a king slime.


I would also assume there would be a list of what types of enemy's turn into what.
 
my screenshot on site 3 is funny... but the dmg of dummy are zero and that mean the do no dmg also don't think i get hurt
 
Been a while since I made an update or even posted. Didn't realize this thread was still so active - I stopped getting alerts for some reason. Anyway, new version is up. Not a ton of new stuff, but the post-Moon Lord prefix category is better fleshed out and no longer conflicts with other prefixes. The two new prefixes for the category are Adaptive and Channeling. Adaptive enemies take only 30% damage from damage types they've been hit by in the past 3 seconds, so they're best dealt with using a variety of weapons. Channeling enemies use the same archetype as Malefic, but steal mana instead of health. When they've stolen 50 mana, they consume it to buff themselves and nearby enemies (+10% damage, defense, max life, knockback resist) as well as healing them for 200 life. The effect stacks, so be careful not to let one turn a crowd of enemies into an unstoppable force.

Oh, yeah, also, the shadow flame ball thing goes through walls. Not as in the explosion goes through walls, but sometimes enemies can cast it and it spawns past fortifications.

Edit: Yeah, not only does the ball go through walls, but the explosion does too. Yikes.

That's a little strange, since it should be spawning from the center of the enemy. Anyway, for the next patch I'll be dropping the velocity of shadowmage and volcanic to make them a little easier to deal with early on, which should also help keep them from passing through walls. Nothing to be done about the explosion, though.

Your Disappearing prefixes might be because of the negative npcids and how those particular npc are created.

Also, I have an idea for a prefix. I don't have a name, but basically if you damage him he will transform into a much stronger NPC. (use the npc.Transform(int newType) method.)

In my personal testing I've found it to happen most often immediately after the world is loaded. The first couple enemies will often not display prefixes.

Interesting idea - do you know if Transform() creates a new NPCInfo instance or uses the original one? It would be a considerable amount of work to implement, but it could be cool to limit the prefix to pre-hardmode and have a pool of hardmode enemies as possible transformations. I'd probably exclude bosses from the list.

Also, some modifiers are WAY too OP on the first few nights. Could you make it to where the more difficult modifiers change after each boss kill pre-hardmode?

What specific modifiers do you consider overbearing early on?


On another note, I'm looking for some specific feedback. Do people feel that Suffixes and certain, strong prefixes should be impossible to roll on bosses? I'm certainly not balancing around the possibility of suffixed bosses, but I'm not sure if more people would prefer to keep it the way it is or remove the possibility entirely.
 
Last edited:
In my personal testing I've found it to happen most often immediately after the world is loaded. The first couple enemies will often not display prefixes.

Interesting idea - do you know if Transform() creates a new NPCInfo instance or uses the original one? It would be a considerable amount of work to implement, but it could be cool to limit the prefix to pre-hardmode and have a pool of hardmode enemies as possible transformations. I'd probably exclude bosses from the list.
Transform looks like it calls SetDefaults again, which would call NPCLoader.SetupNPC, which clears all the npc.npcinfo. So, if you need to old info, save it, otherwise it will be lost. It's probably fine how it happens as it is given how I think you are implementing things.

As for disappearing prefixes: negative NPCid NPC call SetDefaults(), which presumably calls your code, and then sets the NPC.name and NPC.displayName. This is why I thought your code might look like it is failing since the displayName is being overwritten after you set it. A lot of slimes/Zombies/Demon Eyes have negative NPCids, and those you see early on, so my theory might still be right. If you want to fix this, a PreAI check could work.
 
Transform looks like it calls SetDefaults again, which would call NPCLoader.SetupNPC, which clears all the npc.npcinfo. So, if you need to old info, save it, otherwise it will be lost. It's probably fine how it happens as it is given how I think you are implementing things.
Yeah, so it would assign entirely new prefixes to the enemy which would be easier to deal with. I'll toss it into my list of possible features to be added.

As for disappearing prefixes: negative NPCid NPC call SetDefaults(), which presumably calls your code, and then sets the NPC.name and NPC.displayName. This is why I thought your code might look like it is failing since the displayName is being overwritten after you set it. A lot of slimes/Zombies/Demon Eyes have negative NPCids, and those you see early on, so my theory might still be right. If you want to fix this, a PreAI check could work.
My initial suspicion was that the displayName was being overwritten for some reason, but I had no idea why that would be happening. I've not overridden PreAI before - is it called every frame, or just before the AI initializes for the first time? Running a check every frame to see whether an NPC's name matches its prefix data seems like overkill.
 
Back
Top Bottom