Author Topic: Clientside Event Serialization  (Read 715 times)

Well, I'm working on a clientside event saver (Me? Something useful?) and I've been thinking on this a lot...

I've done a few bits and pieces on it, and unless I can find some way to serialize the event on the client side, I don't think I'll be able to make any way to load them back into the dialog.

The basic synopsis is that I'm getting the values of all the parts of the event dialog; that is,
Code: [Select]
WrenchEvents_Box.getObject(eventid).getObject(0-x);In the order of Enabled, Delay, Input, Target, NT (if applicable), Output, and output parameters.

I need a way to convert those parameters into the format that clientcmdaddevent takes, on the client side. I know that the brick calls SerializeEvent(index) to send the event, but I won't be able to do that online.

Does anyone know of a way to find the event indexes from the names? I know all input and output events are stored in a list, but I'm unable to find that list - I found its count/s but cannot find the actual list.
I believe this list IS sent to clients, as I get errors occasionally of events already being registered when I open the event dialog.

If anyone knows where the event lists are, etc. then that would be very appreciated. I already have most other things done.

Look at JVS Doors, that has an example of the server list...

Oh, I was working on the same thing.
Almost done with mine though, not sure on your progress.

List of client-sided event-related variables:
(Information gathered from joining a dedicated LAN server with default add-ons)

$InputEvent_CountfxDTSBrick = 10;
$InputEvent_NamefxDTSBrick_0 = "onActivate";
$InputEvent_NamefxDTSBrick_1 = "onPlayerTouch";
$InputEvent_NamefxDTSBrick_2 = "onBotTouch";
$InputEvent_NamefxDTSBrick_3 = "onProjectileHit";
$InputEvent_NamefxDTSBrick_4 = "onBlownUp";
$InputEvent_NamefxDTSBrick_5 = "onToolBreak";
$InputEvent_NamefxDTSBrick_6 = "onRespawn";
$InputEvent_NamefxDTSBrick_7 = "onRelay";
$InputEvent_NamefxDTSBrick_8 = "onPrintCountOverFlow";
$InputEvent_NamefxDTSBrick_9 = "onPrintCountUnderFlow";
$InputEvent_TargetListfxDTSBrick_0 = "Self fxDTSBrick\tPlayer Player\tClient GameConnection\tMiniGame MiniGame";
$InputEvent_TargetListfxDTSBrick_1 = "Self fxDTSBrick\tPlayer Player\tClient GameConnection\tMiniGame MiniGame";
$InputEvent_TargetListfxDTSBrick_2 = "Self fxDTSBrick\tBot Player\tDriver Player\tClient GameConnection\tMiniGame MiniGame";
$InputEvent_TargetListfxDTSBrick_3 = "Self fxDTSBrick\tPlayer Player\tClient GameConnection\tProjectile Projectile\tMiniGame MiniGame";
$InputEvent_TargetListfxDTSBrick_4 = "Self fxDTSBrick\tPlayer Player\tClient GameConnection\tMiniGame MiniGame";
$InputEvent_TargetListfxDTSBrick_5 = "Self fxDTSBrick\tPlayer Player\tClient GameConnection\tMiniGame MiniGame";
$InputEvent_TargetListfxDTSBrick_6 = "Self fxDTSBrick\tPlayer Player\tClient GameConnection\tMiniGame MiniGame";
$InputEvent_TargetListfxDTSBrick_7 = "Self fxDTSBrick";
$InputEvent_TargetListfxDTSBrick_8 = "Self fxDTSBrick\tClient GameConnection";
$InputEvent_TargetListfxDTSBrick_9 = "Self fxDTSBrick\tClient GameConnection";$OutputEvent_CountfxDTSBrick = 38;
$OutputEvent_CountGameConnection = 5;
$OutputEvent_CountMiniGame = 5;
$OutputEvent_CountPlayer = 13;
$OutputEvent_CountProjectile = 4;
$OutputEvent_NamefxDTSBrick_0 = "setColor";
$OutputEvent_NamefxDTSBrick_1 = "setColorFX";
$OutputEvent_NamefxDTSBrick_10 = "setEmitter";
$OutputEvent_NamefxDTSBrick_11 = "setEmitterDirection";
$OutputEvent_NamefxDTSBrick_12 = "setLight";
$OutputEvent_NamefxDTSBrick_13 = "setItem";
$OutputEvent_NamefxDTSBrick_14 = "setItemDirection";
$OutputEvent_NamefxDTSBrick_15 = "setItemPosition";
$OutputEvent_NamefxDTSBrick_16 = "setMusic";
$OutputEvent_NamefxDTSBrick_17 = "playSound";
$OutputEvent_NamefxDTSBrick_18 = "spawnItem";
$OutputEvent_NamefxDTSBrick_19 = "spawnProjectile";
$OutputEvent_NamefxDTSBrick_2 = "setShapeFX";
$OutputEvent_NamefxDTSBrick_20 = "spawnExplosion";
$OutputEvent_NamefxDTSBrick_21 = "fireRelay";
$OutputEvent_NamefxDTSBrick_22 = "fireRelayUp";
$OutputEvent_NamefxDTSBrick_23 = "fireRelayDown";
$OutputEvent_NamefxDTSBrick_24 = "fireRelayNorth";
$OutputEvent_NamefxDTSBrick_25 = "fireRelayEast";
$OutputEvent_NamefxDTSBrick_26 = "fireRelaySouth";
$OutputEvent_NamefxDTSBrick_27 = "fireRelayWest";
$OutputEvent_NamefxDTSBrick_28 = "cancelEvents";
$OutputEvent_NamefxDTSBrick_29 = "setEventEnabled";
$OutputEvent_NamefxDTSBrick_3 = "setColliding";
$OutputEvent_NamefxDTSBrick_30 = "toggleEventEnabled";
$OutputEvent_NamefxDTSBrick_31 = "setVehicle";
$OutputEvent_NamefxDTSBrick_32 = "respawnVehicle";
$OutputEvent_NamefxDTSBrick_33 = "recoverVehicle";
$OutputEvent_NamefxDTSBrick_34 = "radiusImpulse";
$OutputEvent_NamefxDTSBrick_35 = "incrementPrintCount";
$OutputEvent_NamefxDTSBrick_36 = "decrementPrintCount";
$OutputEvent_NamefxDTSBrick_37 = "setPrintCount";
$OutputEvent_NamefxDTSBrick_4 = "setRendering";
$OutputEvent_NamefxDTSBrick_5 = "setRayCasting";
$OutputEvent_NamefxDTSBrick_6 = "disappear";
$OutputEvent_NamefxDTSBrick_7 = "fakeKillBrick";
$OutputEvent_NamefxDTSBrick_8 = "respawn";
$OutputEvent_NamefxDTSBrick_9 = "killBrick";
$OutputEvent_NameGameConnection_0 = "CenterPrint";
$OutputEvent_NameGameConnection_1 = "BottomPrint";
$OutputEvent_NameGameConnection_2 = "ChatMessage";
$OutputEvent_NameGameConnection_3 = "IncScore";
$OutputEvent_NameGameConnection_4 = "InstantRespawn";
$OutputEvent_NameMiniGame_0 = "ChatMsgAll";
$OutputEvent_NameMiniGame_1 = "CenterPrintAll";
$OutputEvent_NameMiniGame_2 = "BottomPrintAll";
$OutputEvent_NameMiniGame_3 = "Reset";
$OutputEvent_NameMiniGame_4 = "RespawnAll";
$OutputEvent_NamePlayer_0 = "Kill";
$OutputEvent_NamePlayer_1 = "BurnPlayer";
$OutputEvent_NamePlayer_10 = "SpawnProjectile";
$OutputEvent_NamePlayer_11 = "SpawnExplosion";
$OutputEvent_NamePlayer_12 = "ClearTools";
$OutputEvent_NamePlayer_2 = "ClearBurn";
$OutputEvent_NamePlayer_3 = "SetVelocity";
$OutputEvent_NamePlayer_4 = "AddVelocity";
$OutputEvent_NamePlayer_5 = "SetPlayerScale";
$OutputEvent_NamePlayer_6 = "AddHealth";
$OutputEvent_NamePlayer_7 = "SetHealth";
$OutputEvent_NamePlayer_8 = "ChangeDataBlock";
$OutputEvent_NamePlayer_9 = "Dismount";
$OutputEvent_NameProjectile_0 = "Explode";
$OutputEvent_NameProjectile_1 = "Delete";
$OutputEvent_NameProjectile_2 = "Bounce";
$OutputEvent_NameProjectile_3 = "Redirect";
$OutputEvent_parameterListfxDTSBrick_0 = "paintColor 0";
$OutputEvent_parameterListfxDTSBrick_1 = "list None 0 Pearl 1 Chrome 2 Glow 3 Blink 4 Swirl 5 Rainbow 6";
$OutputEvent_parameterListfxDTSBrick_10 = "dataBlock ParticleEmitterData";
$OutputEvent_parameterListfxDTSBrick_11 = "list Up 0 Down 1 North 2 East 3 South 4 West 5";
$OutputEvent_parameterListfxDTSBrick_12 = "dataBlock FxLightData";
$OutputEvent_parameterListfxDTSBrick_13 = "dataBlock ItemData";
$OutputEvent_parameterListfxDTSBrick_14 = "list North 2 East 3 South 4 West 5";
$OutputEvent_parameterListfxDTSBrick_15 = "list Up 0 Down 1 North 2 East 3 South 4 West 5";
$OutputEvent_parameterListfxDTSBrick_16 = "dataBlock Music";
$OutputEvent_parameterListfxDTSBrick_17 = "dataBlock Sound";
$OutputEvent_parameterListfxDTSBrick_18 = "vector 200\tdataBlock ItemData";
$OutputEvent_parameterListfxDTSBrick_19 = "vector 200\tdataBlock ProjectileData\tvector 200\tfloat 0.2 2 0.1 1";
$OutputEvent_parameterListfxDTSBrick_2 = "list None 0 Undulo 1 Water 2";
$OutputEvent_parameterListfxDTSBrick_20 = "dataBlock ProjectileData\tfloat 0.2 2 0.1 1";
$OutputEvent_parameterListfxDTSBrick_21 = "";
$OutputEvent_parameterListfxDTSBrick_22 = "";
$OutputEvent_parameterListfxDTSBrick_23 = "";
$OutputEvent_parameterListfxDTSBrick_24 = "";
$OutputEvent_parameterListfxDTSBrick_25 = "";
$OutputEvent_parameterListfxDTSBrick_26 = "";
$OutputEvent_parameterListfxDTSBrick_27 = "";
$OutputEvent_parameterListfxDTSBrick_28 = "";
$OutputEvent_parameterListfxDTSBrick_29 = "intList 157\tbool";
$OutputEvent_parameterListfxDTSBrick_3 = "bool";
$OutputEvent_parameterListfxDTSBrick_30 = "intList 176";
$OutputEvent_parameterListfxDTSBrick_31 = "dataBlock Vehicle";
$OutputEvent_parameterListfxDTSBrick_32 = "";
$OutputEvent_parameterListfxDTSBrick_33 = "";
$OutputEvent_parameterListfxDTSBrick_34 = "int 1 100 5\tint -50000 50000 50\tint -50000 50000 10";
$OutputEvent_parameterListfxDTSBrick_35 = "int 1 9 1";
$OutputEvent_parameterListfxDTSBrick_36 = "int 1 9 1";
$OutputEvent_parameterListfxDTSBrick_37 = "int 0 9 0";
$OutputEvent_parameterListfxDTSBrick_4 = "bool";
$OutputEvent_parameterListfxDTSBrick_5 = "bool";
$OutputEvent_parameterListfxDTSBrick_6 = "int -1 300 5";
$OutputEvent_parameterListfxDTSBrick_7 = "vector 200\tint 0 300 5";
$OutputEvent_parameterListfxDTSBrick_8 = "";
$OutputEvent_parameterListfxDTSBrick_9 = "";
$OutputEvent_parameterListGameConnection_0 = "string 200 156\tint 1 10 3";
$OutputEvent_parameterListGameConnection_1 = "string 200 156\tint 1 10 3";
$OutputEvent_parameterListGameConnection_2 = "string 200 176";
$OutputEvent_parameterListGameConnection_3 = "int -99999 99999 1";
$OutputEvent_parameterListGameConnection_4 = "";
$OutputEvent_parameterListMiniGame_0 = "string 200 176";
$OutputEvent_parameterListMiniGame_1 = "string 200 156\tint 1 10 3";
$OutputEvent_parameterListMiniGame_2 = "string 200 156\tint 1 10 3";
$OutputEvent_parameterListMiniGame_3 = "";
$OutputEvent_parameterListMiniGame_4 = "";
$OutputEvent_parameterListPlayer_0 = "";
$OutputEvent_parameterListPlayer_1 = "int 0 30 3";
$OutputEvent_parameterListPlayer_10 = "int -100 100 10\tdataBlock ProjectileData\tvector 200\tfloat 0.2 2 0.1 1";
$OutputEvent_parameterListPlayer_11 = "dataBlock ProjectileData\tfloat 0.2 2 0.1 1";
$OutputEvent_parameterListPlayer_12 = "";
$OutputEvent_parameterListPlayer_2 = "";
$OutputEvent_parameterListPlayer_3 = "vector 200";
$OutputEvent_parameterListPlayer_4 = "vector 200";
$OutputEvent_parameterListPlayer_5 = "float 0.2 2 0.1 1";
$OutputEvent_parameterListPlayer_6 = "int -1000 1000 25";
$OutputEvent_parameterListPlayer_7 = "int 0 1000 100";
$OutputEvent_parameterListPlayer_8 = "datablock PlayerData";
$OutputEvent_parameterListPlayer_9 = "";
$OutputEvent_parameterListProjectile_0 = "";
$OutputEvent_parameterListProjectile_1 = "";
$OutputEvent_parameterListProjectile_2 = "float 0 2 0.1 0.5";
$OutputEvent_parameterListProjectile_3 = "vector 200\tbool";


I've done a few bits and pieces on it, and unless I can find some way to serialize the event on the client side, I don't think I'll be able to make any way to load them back into the dialog.

This part is a lot easier than you think; trust me.