I've been messing around with multiplayer stuff a lot lately, and this has come up so many times, so here goes...
Is it possible to have multiple parameters for an ASLEvent in JavaScript?
For example:
ASLEvent ('ServerMoveObject', 'player', 'room');
// Which calls this
<function name="ServerMoveObject" parameters="obj, loc">
MoveObject (GetObject(obj), GetObject(loc))
</function>
This just makes everything look cleaner than
ASLEvent ('ServerMoveObject', 'player; room');
<function name="ServerMoveObject" parameters="cmd">
l = Split (cmd, "; ")
object = GetObject(ToString(l[0]))
location = GetObject(ToString(l[1]))
MoveObject (object, location)
</function>
Especially with a different function, with a lot more parameters, and a lot of advanced JavaScript string holders that are actually used instead of just 'player' and 'room' (not to mention sending around the information between the server and clients)
Then, that brings up another question: Can JavaScript have support for Quest objects?
It doesn't seem like it currently does, because if you do something like...
JS.moveObjectToRoom (player)
// Then, the JavaScript for 'moveObjectToRoom'
function moveObjectToRoom (object) {
ASLEvent ('Log', 'Moving ' + object + ' to room.');
ASLEvent ('ServerMoveObjectToRoom', object);
}
// The Quest function 'ServerMoveObjectToRoom'
<function name="ServerMoveObjectToRoom" parameters="obj">
MoveObject (obj, room)
</function>
...Then Quest says something about not being able to convert a string to an object, and in the log it says 'Moving [object Object] to room.'
I don't even know if it's possible to fix that, but I figured I'd ask.