Jump to content

NPC's not shooting out of dome when enabled

Closed 2.7.4 2.7.5

Ace

Hello Nivex apolgies for the headache, when NPC's are allowed to shoot targets outside dome they refuse to do so except for the ones roof camping how can this be fixed?

Video Example: 

Share this comment


Link to comment

ya it's bugged 😛 I've fixed it in the next update

 line 2972 in .cs

                if (player.IsKilled() || AttackTarget == player)
                {
                    return false;
                }

should be this

                if (player.IsKilled())
                {
                    return false;
                }

                if (AttackTarget == player)
                {
                    return true;
                }

 

Share this comment


Link to comment

hi, edit the .cs file

it's quite easy. I gave you the line number to start at

the first block of the code is what needs replaced with the second block of code

if you edit this directly on the server then oxide will reload the plugin when you save it

Share this comment


Link to comment

Yes I have tried doing that but the "true" and "false" aren't there after "return" if I try to add them it fails to compile. (sorry don't have the best background) 

I added the code you posted in your reply above but without the true and false it compiled but NPC's still don't shoot out of dome only roof campers.

Apolgies if I am doing something wrong, could you tell me what I should be doing instead?

I referenced images of how it looks below.  

As usual Thank you Nivex.

(The Error I get if I paste it exactly how you wrote it "Error while compiling RaidableBases: Since 'RaidableBases.HumanoidBrain.SetTarget(BasePlayer, bool)' returns void, a return keyword must not be followed by an object expression | Line: 2976, Pos: 21")

Screenshot_257.png

Screenshot_258.png

Screenshot_259.png

Edited by Ace
Typo

Share this comment


Link to comment

line 2755

if (!brain.CanLeave(brain.AttackPosition) || !brain.CanShoot())

replace with

if (!brain.CanShoot())

Allow Npcs To Leave Dome When Attacking is bugged and wasn't letting them attack because they can't leave the dome. stationary npc works fine because they can't leave anyway 😛

you don't need to remove your previous edit if you don't want to. it's fine as is. it didn't compile because I gave you code from the next version I'm working on by accident lol

Share this comment


Link to comment

Ah yes, 

This did do the trick wicked! 🥳🥳

Everything works as intended now, NPC's don't shoot through walls or go through walls anymore they stick in there bubble and shoot any players within there view.

Arigato! Nivex, thank you for your quick, effective and kind support. 

With Regards, Ace.  🌹🫡

 

Edited by Ace

Share this comment


Link to comment
1.1m

Downloads

Total number of downloads.

5.7k

Customers

Total customers served.

82.2k

Files Sold

Total number of files sold.

1.6m

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.