Jump to content

Npc Spawn 2.7.9

   (2 reviews)
Message added by KpucTaJl,

This plugin does not have its own functionality. This plugin is only used as an API for other plugins

1 Screenshot

Recommended Comments



Misfit6A

Posted

is this plugin causing issues with convoy not moving and spawning npcs also armored train says its starting but doesnt spawn

Jbird

Posted

On 5/9/2024 at 10:34 PM, Misfit6A said:

is this plugin causing issues with convoy not moving and spawning npcs also armored train says its starting but doesnt spawn

I answered this once just recently but I think it was a different name. Are you in the Mad Mapper Discord or would you want to join to jump in a ticket? Need to check Convoy and ArmoredTrain because I believe the NPCs are driving most things around lately without an issue so check there first with Adem but KpucTaJl and myself will be around as well depending on what is found there.

aimacak

Posted

On 5/10/2024 at 5:34 AM, Misfit6A said:

is this plugin causing issues with convoy not moving and spawning npcs also armored train says its starting but doesnt spawn

@Jbird

I use these plugins and there are no problems, look for the problem in the configurations, first, save yours, delete them, and restart the plugins so that they create a standard one.

7SINS7

Posted

So it uses "Prefab path used for all NpcSpawn NPCs": "assets/rust.ai/agents/npcplayer/humannpc/scientist/scientistnpc_heavy.prefab",
and the skills plugins because of this is giving everyone 600 xp, how can I break this up better.?

Jbird

Posted

20 hours ago, 7SINS7 said:

So it uses "Prefab path used for all NpcSpawn NPCs": "assets/rust.ai/agents/npcplayer/humannpc/scientist/scientistnpc_heavy.prefab",
and the skills plugins because of this is giving everyone 600 xp, how can I break this up better.?

If the plugin has ability to read custom NPC names perhaps you could break it up individually.

Otherwise you can change it to a different NPC that rewards less, and it will change for all of the NpcSpawn NPCs at once.

Komorebi

Posted

NPCs are unable to attack players behind the Prison Cell Gate.

image.png.9fcc616dc5cb569b185119697c499061.png

image.png.9704ad52df89c2ab04242bed55d40915.png

Komorebi

Posted

Players will not be harmed.

Jbird

Posted

On 7/13/2024 at 10:31 AM, Komorebi said:

NPCs are unable to attack players behind the Prison Cell Gate.

Added to our updates feedback and suggestion notes for the next times that the plugin is reviewed for updates. Thank you for the feedback.

imthenewguy

Posted

Hi I am playing around with this plugin. I managed to get the NPC spawning and moving around, but it's state is always set to Roaming. It does not attack me if I go near it or attack it. It's state seems to be stuck in Roaming. What might I be doing wrong?

        JObject GetNpcConfig(NpcConfig npcConfig)
        {
            HashSet<string> states = npcConfig.Stationary ? new HashSet<string> { "IdleState", "CombatStationaryState" } : new HashSet<string> { "RoamState", "ChaseState", "CombatState" };
            JObject sensory = new JObject()
            {
                ["AttackRangeMultiplier"] = npcConfig.attackRangeMultiplier,
                ["SenseRange"] = npcConfig.senseRange,
                ["MemoryDuration"] = npcConfig.memoryDuration,
                ["CheckVisionCone"] = npcConfig.checkVisionCone,
                ["VisionCone"] = npcConfig.visionCone
            };
            JObject config = new JObject()
            {
                ["Name"] = npcConfig.name,
                ["WearItems"] = new JArray { npcConfig.wearItems.Select(x => new JObject { ["ShortName"] = x.shortName, ["SkinID"] = x.skinID }) },
                ["BeltItems"] = new JArray { npcConfig.beltItems.Select(x => new JObject { ["ShortName"] = x.shortName, ["Amount"] = x.amount, ["SkinID"] = x.skinID, ["Mods"] = new JArray { x.Mods.Select(y => y) }, ["Ammo"] = string.Empty }) },
                ["Health"] = npcConfig.health,
                ["RoamRange"] = npcConfig.roamRange,
                ["ChaseRange"] = npcConfig.chaseRange,
                ["DamageScale"] = npcConfig.damageScale,
                ["AimConeScale"] = npcConfig.aimConeScale,
                ["DisableRadio"] = true,
                ["Stationary"] = false,
                ["CanUseWeaponMounted"] = true,
                ["CanRunAwayWater"] = Name != "Underwater Lab" && Name != "Train Tunnel",
                ["Speed"] = npcConfig.speed,
                ["Sensory"] = sensory,
                ["AreaMask"] = 1,
                ["AgentTypeID"] = -1372625422,
                ["HostileTargetsOnly"] = npcConfig.HostileTargetsOnly,
                ["States"] = new JArray { states },

            };

            return config;
        }

        [ChatCommand("spawnnpc")]
        void SpawnNPC(BasePlayer player)
        {
            ScientistNPC npc = NpcSpawn.Call("SpawnNpc", player.transform.position, GetNpcConfig(config.npc)) as ScientistNPC;
            if (npc == null) return;

            SpawnedNPCs.Add(npc);

            NpcSpawn.Call("SetHomePosition", npc, player.transform.position);
        }

 

Jbird

Posted

1 hour ago, imthenewguy said:

Hi I am playing around with this plugin. I managed to get the NPC spawning and moving around, but it's state is always set to Roaming. It does not attack me if I go near it or attack it. It's state seems to be stuck in Roaming. What might I be doing wrong?

Hop into the Mad Mapper Discord and create a ticket. Tag KpucTaJl and myself but will mostly let him go over that with you.

pagan

Posted

Error while compiling NpcSpawn: The name 'f' does not exist in the current context | Line: 24, Pos: 33

  • Like 1
Муреныч

Posted

NpcSpawn - Failed to compile: The name 'f' does not exist in the current context | Line: 26, Pos: 33

aGaming

Posted (edited)

Ошибка в РУ плагине, в 26 строке заменить f на false

Edited by aGaming
aGaming

Posted (edited)

20 minutes ago, Муреныч said:

NpcSpawn - Failed to compile: The name 'f' does not exist in the current context | Line: 26, Pos: 33

в РУ плагине, в 26 строке заменить f на false

Edited by aGaming
  • Like 1
Jbird

Posted

4 hours ago, pagan said:

Error while compiling NpcSpawn: The name 'f' does not exist in the current context | Line: 24, Pos: 33

Check the NpcSpawn config file and make sure to use true or false options.

Jbird

Posted

3 hours ago, Муреныч said:

NpcSpawn - Failed to compile: The name 'f' does not exist in the current context | Line: 26, Pos: 33

Check the NpcSpawn config file and make sure to use true or false options.

Jbird

Posted

3 hours ago, aGaming said:

Ошибка в РУ плагине, в 26 строке заменить f на false

Спасибо за помощь друг.

  • Like 1
Malkizid

Posted

Hi, thanks a lot for providing the new configuration file in recent updated for easier manipulation of Npcs, it really helps a lot.
Instead of having to change the .cs file each time an update is required.

Just to be irritating I have a request / suggestion.

the config line I use:

"Can NpcSpawn NPCs attack other NPCs? [true/false]": true,


The only negative side to this is that, the npcs always attack any other npcs (vanilla or from BotReSpawn for example) if they are agressive or not.

So would it be possible to add another related parameter, that makes it so NpcSpawn bots only attack when provoked?

Or would it be possible for me to edit this in the plugin?  Ufortunately I don't know how to write C# 

Jbird

Posted

23 hours ago, Malkizid said:

Just to be irritating I have a request / suggestion.

the config line I use:

"Can NpcSpawn NPCs attack other NPCs? [true/false]": true,

The only negative side to this is that, the npcs always attack any other npcs (vanilla or from BotReSpawn for example) if they are agressive or not.

So would it be possible to add another related parameter, that makes it so NpcSpawn bots only attack when provoked?

Or would it be possible for me to edit this in the plugin?  Ufortunately I don't know how to write C# 

First I want to point out that depending on their sense range and some of those settings you can likely limit their interactions quite a bit already.

I am curious specific details for what places you have both NPCs and how you are envisioning their actions. Me personally I like simpler because the more we ask for NpcSpawn to do things and check things the more performance it uses, and those small amounts add up when they are being used across the server.

Though if you have specific scenarios and reasons then we might want to consider an option to have some kind of targeting check or damage check of some kind when attacking other NPCs.

  • Like 1
Malkizid

Posted (edited)

On 9/21/2024 at 4:28 PM, Jbird said:

First I want to point out that depending on their sense range and some of those settings you can likely limit their interactions quite a bit already.

I am curious specific details for what places you have both NPCs and how you are envisioning their actions. Me personally I like simpler because the more we ask for NpcSpawn to do things and check things the more performance it uses, and those small amounts add up when they are being used across the server.

Though if you have specific scenarios and reasons then we might want to consider an option to have some kind of targeting check or damage check of some kind when attacking other NPCs.

Hi Jbird, thank you for your reply!

Indeed. I'm aware of all the possible configurations to limit this, but then it limits their performance against the player. So thats not an option for us.  However we have a quite a few bots from events (mainly using NpcSpawn, such as Convoy, HarborEvent, ArmoredTrain, GasStationEvent etc.).

One issue is that NpcSpawn bots attack vanilla Scientists. Which we dont want (as they spawn from bradleys or at monuments etc) or when they spawn from Bradleys in the Convoy event, the Convoy NpcSpawn bots start killing the Scientists spawned from Bradleys.

When we use BotRespawn profiles to send reinforcements which are set to defend the event NpcSpawn bots,  the NpcSpawn bots attack the other. 

When this is intended it is fine, we have roaming npcs or at monuments, some are supposed to be aggresive and some are not. Which makes for great diversity.

So the problem is all our events that use NpcSpawn as a dependency give us no targeting control other than Kill all on sight or kill none and get killed.


or when the config is set to false
"Can NpcSpawn NPCs attack other NPCs? [true/false]":    NpcSpawn bots simply dying from not being able to defend themselves from aggresive roaming bots (such as our zombies and various aggresive roaming or monument based profiles) 

Another such scenario is the BradleyGuards event, which sends NpcSpawn scientists as reinforcements, who then kill the vanilla scientists at Launch site. Which are not supposed to be hostile to them.  They then target other friendly botspawn profiles we have in the area, which are mean to attack the players with the NpcSpawn bots but instead they start a small war and erase eachother.

That's why it would be really great if NpcSpawn bots could only attack when attacked (defend themselves)  and not simply attack any other bot type on sight.  This seemed to work before in older versions when the config did not exist, by editing the older .cs file as written in the description
"with If you need Npcs to be able to fight with other Npcs, then set the value of CanTargetOtherNpc inside the plugin to true"

I understand if its not worth the work, or you are afraid of performance issues, or simply dont want to do it.
But it would allow dynamic PvE servers like ours that depend on 3 various bot plugins to have full dynamic interractions, while NpcSpawn can still maintain out of the box simple functionality it provides.

Edited by Malkizid
Jbird

Posted

On 9/23/2024 at 8:21 AM, Malkizid said:

Hi Jbird, thank you for your reply!

Indeed. I'm aware of all the possible configurations to limit this, but then it limits their performance against the player. So thats not an option for us.  However we have a quite a few bots from events (mainly using NpcSpawn, such as Convoy, HarborEvent, ArmoredTrain, GasStationEvent etc.).

One issue is that NpcSpawn bots attack vanilla Scientists. Which we dont want (as they spawn from bradleys or at monuments etc) or when they spawn from Bradleys in the Convoy event, the Convoy NpcSpawn bots start killing the Scientists spawned from Bradleys.

When we use BotRespawn profiles to send reinforcements which are set to defend the event NpcSpawn bots,  the NpcSpawn bots attack the other.

Thank you for more clarity and feedback. For me it was just more of gauging what the fix could be so that I can condense and relay it to the developer. But also to make sense of it even myself. Admittedly at first I'm was trying to figure out if this was more of a case of who shoots first. Which it is not and thank you for explaining. It sounds like it may just be something that would be good to add as either an universal option that they don't shoot first, or possibly even a split option by different events and even custom files for example, where they can be given different levels of aggression. I will let the developer make the last decision but that gives me much more detail and examples to work with so thank you again. I'll add something about this.

  • Love 1
Malkizid

Posted

20 hours ago, Jbird said:

Thank you for more clarity and feedback. For me it was just more of gauging what the fix could be so that I can condense and relay it to the developer. But also to make sense of it even myself. Admittedly at first I'm was trying to figure out if this was more of a case of who shoots first. Which it is not and thank you for explaining. It sounds like it may just be something that would be good to add as either an universal option that they don't shoot first, or possibly even a split option by different events and even custom files for example, where they can be given different levels of aggression. I will let the developer make the last decision but that gives me much more detail and examples to work with so thank you again. I'll add something about this.

Thank you Jbird for your reply and consideration and passing this information onto KpucTaJl.
I'm glad I was clear enough, I was concerned my examples were not so concise.

Those  optons you mentioned as universal settings would be really useful and hopefully could improve the API / Plugin  without reducing performance.
Optional aggression levels such as defensive (shoots back at attackers) or  aggresive (shoots on sight) or passive (ignores all)  would be excellent if feasible.

Thanks again.
Best regards,
Manky

Jbird

Posted

1 hour ago, Malkizid said:

Thank you Jbird for your reply and consideration and passing this information onto KpucTaJl.
I'm glad I was clear enough, I was concerned my examples were not so concise.

Those  optons you mentioned as universal settings would be really useful and hopefully could improve the API / Plugin  without reducing performance.
Optional aggression levels such as defensive (shoots back at attackers) or  aggresive (shoots on sight) or passive (ignores all)  would be excellent if feasible.

Thanks again.
Best regards,
Manky

I am still dumb when it comes to raw code, I'm going to be honest there. I made more progress with map and prefab knowledge than with code. But I've seen how easily performance can be affected. Even through Facepunch updates. It was not too long ago that we have dealt with two performance pains to overcome. One with the water update and before that with an NPC update. Both systems were given many additions and changes, which while they have had positive effects on the gameplay and feel of the game, both created performance challenges when working with those systems.

Thank you again as well for the feedback examples and explanation. Once KpucTaJl has had a chance to review the notes he will consider potential implementation the next times he is working on updates for NpcSpawn.

  • Like 1
Malkizid

Posted

1 minute ago, Jbird said:

I am still dumb when it comes to raw code, I'm going to be honest there. I made more progress with map and prefab knowledge than with code. But I've seen how easily performance can be affected. Even through Facepunch updates. It was not too long ago that we have dealt with two performance pains to overcome. One with the water update and before that with an NPC update. Both systems were given many additions and changes, which while they have had positive effects on the gameplay and feel of the game, both created performance challenges when working with those systems.

Thank you again as well for the feedback examples and explanation. Once KpucTaJl has had a chance to review the notes he will consider potential implementation the next times he is working on updates for NpcSpawn.

I know little to nothing about programming or writing code myself, other than looking for obvious cues in c# or how .json should be formatted but after seeing the effects on Plugin functionality after such changes  FacePunch make to the game, I can understand the amount of work that has to be done and how easily those changes can break all the work all plugin devs do. I appreciate it all!

 

EvilDips

Posted

Is the recent update safe to use now or wait for wipe?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Like 17
  • Love 10

User Feedback

1.4m

Downloads

Total number of downloads.

6.8k

Customers

Total customers served.

101.5k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

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