View unanswered posts | View active topics It is currently 12 Dec 2017 08:26

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.



Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Performing actions on character connection/game init 
Author Message
Rising Hero

Joined: 27 Jun 2011 13:20
Posts: 310
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?


07 Sep 2017 22:36
Profile
Apprentice

Joined: 20 May 2017 15:25
Posts: 47
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.


08 Sep 2017 16:46
Profile
Expert
User avatar

Joined: 16 Nov 2014 23:10
Posts: 275
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.


08 Sep 2017 19:07
Profile
Rising Hero

Joined: 27 Jun 2011 13:20
Posts: 310
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?


08 Sep 2017 20:00
Profile
Expert
User avatar

Joined: 16 Nov 2014 23:10
Posts: 275
fix?

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


08 Sep 2017 23:43
Profile
Rising Hero

Joined: 27 Jun 2011 13:20
Posts: 310
Code:
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.


09 Sep 2017 13:10
Profile
Expert
User avatar

Joined: 16 Nov 2014 23:10
Posts: 275
You recover? Should be after that, yeah?


09 Sep 2017 16:12
Profile
Rising Hero

Joined: 27 Jun 2011 13:20
Posts: 310
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.


10 Sep 2017 18:50
Profile
Adept

Joined: 24 Jan 2016 21:27
Posts: 134
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. :?


10 Sep 2017 23:37
Profile
Rising Hero

Joined: 27 Jun 2011 13:20
Posts: 310
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.


11 Sep 2017 00:21
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 16 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.