Events from the client
  • Hello all-

    How are events propagated from the client? And how does one add new events?

    For instance, maybe the server wants to add new verbs like "throw" or "shout" or "think happy thoughts". At any time, a client (character) can do one of those verbs. And the server needs to know when that happens, because other actions may be triggered by that.

    Does each new verb require custom coding in each client? That is, do ember and sear have to update with every new verb? Or is there some way that new verbs can be passed from the client (through the console or otherwise) that don't require code changes?

    Also, what events does the server receive now? I was looking in the cyphesis console and logs, and I didn't see any messages when characters said something. But obviously that is supposed to be propagated to other clients, so maybe many events aren't logged?

    -Thomas
  • As an example, I tried adding a new operation to a hammer, called "throw". I set up a "fly" task (not a great name, but anyway) that would be triggered by the throw action, in the same way that the ram task is triggered by the strike action.

    I also added a Fly.py task script, basically a copy of the Ram.py script with a few tweaks.

    However, I didn't see any way to exercise that on the client. If I equip a hammer, I see an option to strike things with the hammer when I click on them. But I never see an option to throw the hammer, even though I configured that the same as striking.

    So I take it all actions and operations must have custom code added by the client application? Or did I configure something incorrectly?
  • I think there's some bug in Ember that makes it only show the first defined action, even if there are other actions defined as well. I'll look into it.
    https://bugs.launchpad.net/ember/+bug/150624
  • It is possible this is a bug in ember - I can't check at the moment as I have a few technical issues.

    There are two things in mason.xml which enable the Ram.py script. The first is the "ram" task declaration, and the seconds is the "strike" operation definition. "ram" tells the server where the script for that task is, and when it can be activated. "strike" defines the type of message the client sends to request the "ram" task.

    To add your "fly" task, you will need two new entries in mason.xml. An operation definition for "throw", for which you should copy the definition for strike, and the task declaration for "fly". No it is not a good name, but not to worry.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID