-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable hostile ai on protected grids #2398
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a bit much to me, and open to some exploitation. I'll defer to others, but doesn't seem critical.
Left a recommendation to remove the mob and all of its contents, Dvir had something like this for the salvage mob restrictions off the top of my head.
// Frontier: Disable hostile AI in pacified zones | ||
var grid = Transform(uid).GridUid; | ||
if (grid != null && EntityManager.TryGetComponent<ProtectedGridComponent>(grid, out _)) | ||
{ | ||
if (EntityManager.TryGetComponent<NpcFactionMemberComponent>(uid, out var npcFactionMemberComponent)) | ||
{ | ||
if (_npcFaction.IsFactionHostile("NanoTrasen", (uid, npcFactionMemberComponent))) | ||
continue; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going this far, why not just kill them, gib them, and delete their contents? No iteration, fewer entities, nothing to gain by dragging crabs into the zone. They provide no threat, shouldn't reward coming back into a hidey hole.
Might also want to use another flag for this, ProtectedGrid could just mean "I'd like the floors in one piece".
if (grid != null
&& TryComp<ProtectedGridComponent>(grid, out var protectedGrid)
&& protectedGrid.KillHostileMobs
&& TryComp<NpcFactionMemberComponent>(uid, out var npcFactionMember)
&& _npcFaction.IsFactionHostile("NanoTrasen", (uid, npcFactionMember))
{
// turn it into dust, could play a funny noise
continue;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent idea. i will change this soonish
About the PR
Disabled hostile ai on protected grids like transport shuttle and frontier outpost
Why / Balance
Hostile mobs seem to get on board protected areas way too often and kills ssd players mostly, leaving a mess.
How to test
Spawn any hostile AI that may attack things on frontier and check if it just does nothing, as intended.
Also spawn other AI like chicken, cow, CDET should still work too.
I tested this by dragging AI from a protected grid to a normal grid, which then reactivates the AI again, which may come as a suprise but if players push them out of the docks of frontier, it 'should' not hit the player - but it might ? . Either way better than what it was.
Media
Recording.2024-11-13.113915.mp4
Requirements
Breaking changes
No breaking changes.
Changelog
🆑