Author Topic: MiniGame Target Support for More Input Events  (Read 703 times)

If you set an input event to something like onActivate, onPlayerTouch, etc. you can set the target to MiniGame, and it works perfectly fine.

Meanwhile, there are some other events, such as onPrintCountOver/UnderFlow, onRelay, etc. that DON'T have MiniGame in the target list.



For example, if you have print bricks that count down how long until the minigame resets, you won't be able to reset via the onPrintCountUnderFlow event.

All I really want is to be able to use the MiniGame target from the print count underflow event, but I'm sure other people would like to use it via the relay events.

Thanks for considering.

This could easily be done by Badspot.

I found an add-on that adds the MiniGame and Bot targets to the onRelay, so I modified the script:

Code: [Select]
//Original script by Visolator/Advanced Bot:
//http://forum.blockland.us/index.php?topic=251989.0

//Modified by Legojak

registerInputEvent(fxDtsBrick,"onPrintCountUnderFlow","Self fxDtsBrick" TAB "Player Player" TAB "Client GameConnection" TAB "Minigame Minigame");

function fxDTSBrick::onPrintCountUnderFlow(%obj, %client)
{
%mini = getMinigameFromObject(%client);
$InputTarget_["Self"]   = %obj;
$InputTarget_["Player"] = %client.player;
$inputTarget_["Client"] = %client;
$inputTarget_["Minigame"] = %mini;
%obj.processInputEvent("onPrintCountUnderFlow", %client);
}

registerInputEvent(fxDtsBrick,"onPrintCountOverFlow","Self fxDtsBrick" TAB "Player Player" TAB "Client GameConnection" TAB "Minigame Minigame");

function fxDTSBrick::onPrintCountOverFlow(%obj, %client)
{
%mini = getMinigameFromObject(%client);
$InputTarget_["Self"]   = %obj;
$InputTarget_["Player"] = %client.player;
$inputTarget_["Client"] = %client;
$inputTarget_["Minigame"] = %mini;
%obj.processInputEvent("onPrintCountOverFlow", %client);
}

Solved and locked.