Jump to content

NPC's not shooting out of dome when enabled

Closed 2.7.4 2.7.5

Ace
Ace

Posted

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: 

nivex

Posted

hi, post the profile for this and your config

Ace

Posted (edited)

Thanks Nivex here you go, 

 

Edited by Ace
nivex

Posted

np. ok, will take a look for you

nivex

Posted

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;
                }

 

Ace

Posted

Awesome! Thank you Nivex. 

So shall I just wait for the next update?

or could you give me the file with the fix? 

🥳

nivex

Posted

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

Ace

Posted (edited)

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
nivex

Posted

the profile and config are missing so I can't check them again

Ace

Posted (edited)

Oh, Sorry.

 

Edited by Ace
nivex

Posted

ok, trying to figure it out

nivex

Posted

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

Ace

Posted (edited)

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
nivex

Posted

no problem enjoy!

nivex

Posted

Changed Status from Pending to Closed

Changed Fixed In to Next Version

1.6m

Downloads

Total number of downloads.

7.7k

Customers

Total customers served.

116.1k

Files Sold

Total number of files sold.

2.4m

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.