Jump to content

evict

Member
  • Posts

    10
  • Joined

  • Last visited

Everything posted by evict

  1. Hi! That's ok, no worries. I can wait for a reply here. When you have an answer from the developer, please let me know. Cheers!
  2. Hi! First of all, thank you very much for this plugin. All the recent updates are great. For context, I'm using NpcSpawn integrated to my plugin to allow players to recruit bots to fight by their side. The thing is, since the recent changes on NpcSpawn, I'm unable to allow players to damage their own allied bots because of this logic you implemented inside the OnEntityTakeDamage hook if (victimNpc.CanTargetEntity(attacker)) { if (info.isHeadshot && victimNpc.Config.InstantDeathIfHitHead && attacker is BasePlayer basePlayer && basePlayer.IsPlayer()) info.damageTypes.ScaleAll(victimNpc.health / info.damageTypes.Total()); else { info.damageTypes.ScaleAll(info.boneArea switch { HitArea.Head => victimNpc.Config.HeadDamageScale, HitArea.Chest or HitArea.Stomach or HitArea.Arm or HitArea.Hand => victimNpc.Config.BodyDamageScale, HitArea.Foot or HitArea.Leg => victimNpc.Config.LegDamageScale, _ => 1f }); if (attacker is CustomScientistNpc attackerNpc && IsCustomScientist(attackerNpc)) info.damageTypes.ScaleAll(attackerNpc.Config.NpcDamageScale); victimNpc.SetKnown(attacker); victimNpc.TrySendTargetGroup(attacker); } return null; } else { if (attacker is BasePlayer player && player.IsPlayer() && (player.limitNetworking || player.isInvisible)) return null; return true; } The problem is, I want the allied bots to not be able to target their allied players, but the players must be able to damage their own bots even though the bots can't target them back. (so players can kill their own bots if they get stuck somewhere or even accidentaly during fights). But with this condition if (victimNpc.CanTargetEntity(attacker)) you implemented this seems to be impossible now. Is there a possibility that you can add another config inside NpcConfig like: bool CanBeDamagedByAnySources false by default but if true, ignore this condition here and allow any damages from any sources (return null in the hook)?
  3. Also does not work for wolves. I guess all animals with new improved AI do not inherit from BaseAnimal, so NpcSpawn logic fail to aggro these entities.
  4. Even with the flag set to true, CustomScientistNpcs are ignoring tigers, panthers and crocs
  5. Awesome news, thanks for taking a second look into it. Cheers
  6. @Jbirdmy problem is not with targeting, my problem is with damage. NpcSpawn is preventing damage if skinId = 11162132011012. It returns true in OnEntityTakeDamage in the first line (Where returning anything different than null cancels the damage) Meaning I can make them target each other but they can't damage each other. I can resort to a messy workaround by changing the HitInfo attacker or by duplicating the hit on my plugin, but this is not ideal. My suggestion is a new flag CanDamageNpcSpawns and not anything related to targeting at all
  7. Hi, I`m developing a plugin where players can run a command to spawn a NpcSpawn's NPC that will serve as allies, will follow them and defend. Here is a sneak peak of the plugin: Even though NpcSpawn allow CustomScientists to target and damage regular Npcs I noticed NpcSpawn prevents any damage between two NpcSpawns in this line where it compares the SkinID of the victim and forces a return true in this hook. private object OnEntityTakeDamage(BaseCombatEntity victim, HitInfo info) { if (victim == null || info == null) return null; BaseEntity attacker = info.Initiator; if (IsCustomScientist(victim)) { if (attacker == null || attacker.skinID == 11162132011012) return true; ... if (IsCustomScientist(attacker)) { if (victim.skinID == 11162132011012) return true; ... The problem is I want recruits from different factions to be able to target and damage each other so players can have bot wars. Can you add an additional optional flag in NpcConfig, let's say NpcConfig.CanDamageNpcSpawns? (default false so it does not break any current plugins using NpcSpawn) And then, make this skinId checks only for CustomScientists with the flag set to false so I can spawn my bots with this flag = true and have the ability to damage other NpcSpawns since in my plugin they act as player allies that should be able to fight other player recruits. Thanks!

About Us

Codefling is the largest marketplace for plugins, maps, tools, and more, making it easy for customers to discover new content and for creators to monetize their work.

Downloads
2.7m
Total downloads
Customers
11.6k
Customers served
Files Sold
165.2k
Total sales
Payments
3.6m
Processed total
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.