Skip to content
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

Logout trigger for NPCs #1322

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

canerksk
Copy link
Contributor

@Logout trigger When NPCs (mounts) are logged out of the session in any way, i.e. mounted or minimised, they will log out (disconnect) but will not trigger.

@Logout trigger When NPCs (mounts) are logged out of the session in any way, i.e. mounted or minimised, they will log out (disconnect) but will not trigger.
@Jhobean
Copy link
Contributor

Jhobean commented Oct 25, 2024

Since it's a particular situation on a particular NPC, should we really use the @logout trigger?

I mean, we disconnect the mount when we climb on it to avoid it take damage and maybe more reason. If the purpose is really explicitly for this situation, could we use something like @Dismounted and place it directly on the dismount method? Juste after the @Dismont for player.

@canerksk
Copy link
Contributor Author

Since it's a particular situation on a particular NPC, should we really use the @logout trigger?

I mean, we disconnect the mount when we climb on it to avoid it take damage and maybe more reason. If the purpose is really explicitly for this situation, could we use something like @Dismounted and place it directly on the dismount method? Juste after the @Dismont for player.

In fact, a mount can be logged out not only when it is mounted but also when we directly .xdisconnect it to the mount. Previously, this trigger was not triggered when a mount was disconnected with .xdisconnect.

It also disconnects when the mount is shrink.

@cbnolok
Copy link
Contributor

cbnolok commented Nov 19, 2024

That's interesting. Do you have any use cases in mind?

@canerksk
Copy link
Contributor Author

That's interesting. Do you have any use cases in mind?

Actually, the disconnect event for NPCs is completely incomplete right now, that is, an entity can be .xdisconnected, when .allshow is set to 1, this entity appears in the [logout] position but cannot be called back, that is, something like .xdisconnect 0 or .xconnect should be for NPCs as well, that is, since disconnect can be used for NPCs as well, then I think these should work without problems. For example, we should be able to .disconnect 1 the mount of a player who enters an area, and .connect that mount again when the player leaves the area, and naturally @login and @logout should be triggered on that mount or NPC, if it can be disconnected, these should be done too.

@cbnolok
Copy link
Contributor

cbnolok commented Nov 27, 2024

I understand the principle and i think having npcs call a disconnect trigger won't cause any harm.
Though, having them calling the same one being used until now for players will cause headaches with existing scripts. I'd suggest using a new NPCDisconnect trigger. Also, afaik, we don't call @Login for NPCs, so we'd better adding also NPCConnect.
That said, maybe because i haven't been scripting in a while, i don't see any useful reason to manually disconnect and connect an npc; you have provided an example but i still don't see why one could want to do that. Could you provide us more insight on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants