Performing actions on character connection/game init

General discussion about the Genesis Web Client located at https://www.genesismud.org/play/

Moderator: Eowul

Forum rules
- Use common sense and be respectful towards each other at all times, even when disagreeing.
- Do not reveal sensitive game information. Guild secrets, player seconds are examples of things not allowed.
mallor
Rising Hero
Posts: 371
Joined: 27 Jun 2011 13:20

Performing actions on character connection/game init

Post by mallor » 07 Sep 2017 22:36

Hi, all.

I need to perform JS code when game is loaded or character is connected.
I've tried to create GMCP triggers on both core.hello and char.login, but they were never triggered.
What am I missing?

Zugzug
Veteran
Posts: 233
Joined: 20 May 2017 15:25

Re: Performing actions on character connection/game init

Post by Zugzug » 08 Sep 2017 16:46

for example, if you want to sendGMCP([[Core.Options { "npc_comms" : "off" }]]) on gmcp.char.login you have to put it on some delay, as it doesn't work otherwise. Not sure why, but a few seconds is enough.

User avatar
Alisa
Hero
Posts: 392
Joined: 16 Nov 2014 23:10

Re: Performing actions on character connection/game init

Post by Alisa » 08 Sep 2017 19:07

the webclient js triggers and such are loaded with your characters login, as i understand it, so it would be hard to trigger on that part.

mallor
Rising Hero
Posts: 371
Joined: 27 Jun 2011 13:20

Re: Performing actions on character connection/game init

Post by mallor » 08 Sep 2017 20:00

Alisa wrote:the webclient js triggers and such are loaded with your characters login, as i understand it, so it would be hard to trigger on that part.
So it seems, the triggers are simply loaded too late.
Any chance we can get a fix? Just trigger the char.login once triggers are loaded, in any case triggers are loaded only after the login?

User avatar
Alisa
Hero
Posts: 392
Joined: 16 Nov 2014 23:10

Re: Performing actions on character connection/game init

Post by Alisa » 08 Sep 2017 23:43

fix?

Trigger on a line done after login.. like the "last login was from" or something like that.

mallor
Rising Hero
Posts: 371
Joined: 27 Jun 2011 13:20

Re: Performing actions on character connection/game init

Post by mallor » 09 Sep 2017 13:10

Code: Select all

Welcome to Genesis 3.1, maintenance release.
Last login at  : Sat Sep  9 11:57:34 2017
Last login from: ::1
This is a big dark hall with rows of beds in it. Every warrior from Angmar's
army has his own bed here and whenever he wishes to, he can sleep here.
There is one obvious exit: east.
> 
Loaded 36 triggers (14 enabled)
Loaded 37 aliases (31 enabled)
As you can see triggers REALLY load last.

User avatar
Alisa
Hero
Posts: 392
Joined: 16 Nov 2014 23:10

Re: Performing actions on character connection/game init

Post by Alisa » 09 Sep 2017 16:12

You recover? Should be after that, yeah?

mallor
Rising Hero
Posts: 371
Joined: 27 Jun 2011 13:20

Re: Performing actions on character connection/game init

Post by mallor » 10 Sep 2017 18:50

Alisa wrote:You recover? Should be after that, yeah?
You don't always recover.

I wonder how hard would it be to trigger char.login event right after loading triggers? Additional line of code, I can do it and send it to whoever needed, if they're THAT busy.

Drazson
Titan
Posts: 499
Joined: 24 Jan 2016 21:27

Re: Performing actions on character connection/game init

Post by Drazson » 10 Sep 2017 23:37

The order in which those messages appear (You recover *items*, Welcome Gardener, triggers enabled etc) change oftentimes. I decided to just make an "armself" alias to do stuff when im back in the realms manually. :?

mallor
Rising Hero
Posts: 371
Joined: 27 Jun 2011 13:20

Re: Performing actions on character connection/game init

Post by mallor » 11 Sep 2017 00:21

I initialize mine with alias manually right now as well, but I'm looking for a more consistent way, than relying on messages that might or might not show up during logging on.

Post Reply
http://tworzymyatmosfere.pl/przescieradla-jedwabne-z-gumka/