mcmonkeyprojects / Sentinel

Combat NPCs for Spigot!
MIT License
165 stars 85 forks source link

Custom Messages When Acquiring Targets #271

Closed shawngiese closed 3 years ago

shawngiese commented 5 years ago

For Sentinel,

It would be fun if we could have sentinel return / run to a selected location (a base maybe) on trigger... like spies, or thieves watching a path. Then maybe pass a location marker (what the sentinel was watching) for a destination to others (their group, more guards). Or wake everyone up / send them to their posts. If that is getting too complex having them shout out something as they ran back to base would also set the mood.

I was thinking that the sentinel would guard an area but when it saw something (say two target creatures) it would trigger something like run and get help, or call out 'intruders, intruders' that could trigger others NPCs to come. Or if they were thieves and saw more than one person (maybe with a diamond) they could go get some more friends to attack.

Could make a fun dynamic so when the players figured it out they could send one person to draw off the group and then go raid their camp.

mcmonkey4eva commented 5 years ago

It actually seems like you want a level of complexity / customization that while it would be cool for Sentinel to handle, is possibly more of a place where you'll want to start scripting server-specific logic. I (very biasedly) recommend that you try using Denizen: https://www.spigotmc.org/resources/denizen.21039/ A scripting engine that interacts with Citizens (and as well Sentinel) to enable incredible levels of customization on a server. Denizen, Citizens, and Sentinel share a Discord server if you want to learn more / discuss this option: https://discord.gg/Q6pZGSR


That said, there may be some things that can be added in Sentinel from this idea, that if all added might just about build what you're dreaming up:

shawngiese commented 5 years ago

Thanks for considering the new feature... trying to get some more role playing out of the NPCs. I will definitely look at the denizen.

Those possible additions would get pretty close to what I am aiming at... return to spawn event, avoid this / target that mix looks great too. Advanced messaging... well that would be icing on top... especially if you could attach it to an event. For example... player distance 2, message - narrated format "you hear movement nearby" player distance 1, message - "Alert, soldiers!" as lookout runs to camp

mcmonkey4eva commented 5 years ago

I've made some major additions towards this functionality... see the readme for details, but of particular note:

There is now an event:message,SOME_TEXT target/avoid available. So you can do event:message,help and it will react when a player says "help!" in chat nearby.

There isn't yet a message response to targets available. (Not sure if that's worth adding atm, would be a rather complicated addition) It's just able to avoid or attack people that post the message for the moment.

There is now multi target support - done like /sentinel addtarget multi:zombie,zombie,creeper (targets 2 zombies and 1 creeper)

There is now more-specific targets support - done like /sentinel addavoid allinone:player|helditem:diamond_sword targets a player that is holding a sword

There isn't yet a "safe spot to run back to" available (will likely add soon)

mcmonkey4eva commented 5 years ago

Update: as of Sentinel build DEV-238+, you can do /sentinel avoidreturnpoint to set the safe spot to run back to.

shawngiese commented 5 years ago

Great, thanks! Looking forward to try these changes out.

axemwa commented 5 years ago

I support the idea of custom messages when acquiring targets, maybe could even add a cooldown for how many seconds or ticks apart each message appears as well so that it doesn't spamm chat

axemwa commented 5 years ago

How do I remove /sentinel addavoid allinone:player|helditem:diamond_sword? Using the same command with removeavoid doesn't work?

mcmonkey4eva commented 5 years ago

/sentinel removeavoid allinone:0 (the 0 is the numbered index of the target label in the targets list ... it's set up this way to just be less of a pain)

mcmonkey4eva commented 5 years ago

Please use the #sentinel-lobby channel on the Discord https://discord.gg/Q6pZGSR for general help questions.

mcmonkey4eva commented 3 years ago

I think with the available Sentinel events in Denizen and the features already core to Denizen itself (proximity trigger, etc) you can build the custom messages and other advanced handling yourself. Given that, and that the other requests were added, I'm going to call this issue completed.