This is a little resource I made that allows you to add output targets to existing input events.
DownloadServer Target Demonstration:
new scriptObject(ServerEventTargetSO);
function ServerEventTargetSO::echo(%this,%val)
{
echo(%val);
}
addEventTarget("Server ServerEventTargetSO","","ServerEventTargetSO.getID()");
registerOutputEvent(ServerEventTargetSO,"Echo","string 200 176",0);
This would allow you to create events like
onActivate => Server => Echo [Hello, world!]Slayer Teams Demonstration:
addEventTarget("Team(Client) Slayer_TeamSO","GameConnection","%client.getTeam()");
addEventTarget("Team(Brick) Slayer_TeamSO","fxDtsBrick","%this.getControlTeams()");
registerOutputEvent(Slayer_TeamSO,"BottomPrintAll","string 200 156" TAB "int 1 10 3" TAB "bool 0",1);
- The first argument is the name of the target and the class of the target, separated by a space.
- The second argument is the prerequisite target class. For example, the Team(Client) target will only display on events that already have a target of class GameConnection, while the Team(Brick) target will only display on events with an existing target of class fxDtsBrick. Leave this blank for no prerequisite.
- The third argument is the code used to find the target. Variables that can be used are %client and %this.
Source Code (v1.1)v1.1:
- Prevented duplicate entries.
- Added some commenting.