Author Topic: Will this event work?  (Read 904 times)

Code: [Select]
registerOutputEvent("Minigame", "ReloadHungerGames", "", 1);
function serverDirectSaveFileLoad(%HungerGames, 3, "", %0);
}
I want the event to load the save specified in the code because some of the bricks will destroy themselves in the process of playing, so understandably, I want to reload the complete save when the minigame is reset. Will this code function correctly?

seems like it'd need to be more like
Code: [Select]
registerOutputEvent("Minigame", "ReloadHungerGames", "", 1);
function ReloadHungerGames
{
    serverDirectSaveFileLoad(%HungerGames, 3, "", %0);
}
and you could test it yourself
edit: looking at other events dealing with minigames, try a function name of MinigameSO::ReloadHungerGames, while keeping the first line the same
« Last Edit: November 05, 2012, 12:33:07 AM by phflack »

Code: [Select]
registerOutputEvent("Minigame", "ReloadHungerGames", "", 1);
function ReloadHungerGames
{
    serverDirectSaveFileLoad(%HungerGames, 3, "", %0);
}
Doesn't take a genius to know that this won't work at all.

Code: [Select]
registerOutputEvent("Minigame", "ReloadHungerGames", "", 1);
function ReloadHungerGames(%client)
{
    serverDirectSaveFileLoad(%HungerGames, 3, "", %0);
}
You forgot the argument list after the function name. Fixed for you.


You forgot the argument list after the function name. Fixed for you.
%HungerGames = ?
%0 no worky
%client unneeded
minigame::reloadhungergames*
1 in registeroutputevent unneeded

%HungerGames = ?
%0 no worky
%client unneeded
minigame::reloadhungergames*
1 in registeroutputevent unneeded
I didn't say I fixed his code, I just made it syntaxically correct. I figured he'd used the right arguments for the actual function, I didn't even look at it. And I included %client because he used 1 as the final argument in registerOutputEvent.

Code: [Select]
registerOutputEvent("Minigame", "ReloadHungerGames", "", 1);
function MiniGameSO::ReloadHungerGames(%this, %client)
{
    serverDirectSaveFileLoad("saves/HungerGames.bls", 3);
}
There's the fully correct function. Just save the bricks as "HungerGames" and it should work.
« Last Edit: November 05, 2012, 06:44:30 PM by Trinick »

it didn't look like it needed any arguements, i was just fixing his odd function declaration, assuming everything else was tested by him

I didn't say I fixed his code
Yeah but looking at his answer he thought you did
Also isn't the 1 and %client unneeded

Yeah but looking at his answer he thought you did
Also isn't the 1 and %client unneeded
You're right, but they're not hurting his code. I assumed he probably wanted some kind of client check (e.g. if they're admin) that he would add later, so I left it in.

You're right, but they're not hurting his code. I assumed he probably wanted some kind of client check (e.g. if they're admin) that he would add later, so I left it in.
Yea, makes sense