I'm extremely new to making events and stuff, and I've been having a problem with one thing. Calling a mini-game output through an input event. For example:
onInput->Minigame->OutputI decided to create an onBrickTrigger input and brickTrigger output events for practice, and I noticed the error above.
Here's the code:
*Note* I added in echo functions to see if %client.minigame was actually the correct thing. FYI, it is the correct thing. *Note*
RegisterInputEvent(fxDtsBrick, "onBrickTrigger", "Self fxDtsBrick" TAB "Player Player" TAB "Client gameConnection" TAB "Minigame Minigame");
registerOutputEvent("fxDtsBrick", "brickTrigger");
function fxDtsBrick::brickTrigger(%this)
{
%client = %this.getGroup().client;
echo(%client.minigame);
$InputTarget_["Self"] = %this;
$InputTarget_["Player"] = %client.player;
$InputTarget_["Client"] = %client;
$InputTarget_["Minigame"] = %client.minigame;
%this.processInputEvent("onBrickTrigger", %this);
}
I've tried to find some resources, used Amade's bot event 'onBotKilled' for some insight on using 'Minigame', I echoed the minigame value on his event and it was the same as mine, but it actually worked.
onBotKilled -> Minigame -> chatMsgAll[Blah.] //Works
onBotKilled -> Self -> brickTrigger
onBrickTrigger -> Minigame -> chatMsgAll[Blarg.] //Doesn't work
RegisterInputEvent(fxDtsBrick, "onBotKilled", "Self fxDtsBrick" TAB "Killer Player" TAB "Killer(Client) GameConnection" TAB "Corpse Player" TAB "Minigame Minigame");
function armor::onDisabled(%this, %obj)
{
parent::onDisabled(%this, %obj);
if(%obj.getClassName() $= "AIPlayer" && isObject(%brick = %obj.spawnBrick))
{
%obj.setImageTrigger(0, 0);
%obj.setImageTrigger(1, 0);
if(isObject(%obj.client))
{
%obj.client.delete();
}
if(isObject(%client = %obj.lastPusher) && (%obj.lastPushTime + 1000) > getSimTime())
{
%obj.setImageTrigger(0, 0);
%obj.setImageTrigger(1, 0);
%killer = %obj.lastPusher.player;
$InputTarget_["Self"] = %brick;
$InputTarget_["Killer"] = %killer;
$InputTarget_["Killer(Client)"] = %killer.client;
$InputTarget_["Corpse"] = %obj;
$InputTarget_["Minigame"] = %killer.client.minigame;
echo(%killer.client.minigame);
%brick.processInputEvent("onBotKilled", %client);
}
}
}
Thanks in advance.