Author Topic: loadAddOns Parent Not Working [Solved]  (Read 775 times)

Code: [Select]
package setRandomSpeedKart
{
function loadAddOns()
{
echo("\c2Add-Ons loaded.");

parent::loadAddOns();

echo("\c2Add-Ons loaded.");

//Do this stuff after all add-ons have been executed.
if(!setRandomSpeedKart_Check())
{
error("No speedkarts found.");
}
}
};
activatePackage(setRandomSpeedKart);
I want to have the console display an error if setRandomSpeedKart_Check() returns false after all add-ons have been executed. So I parented the loadAddOns function to do this and put the error after the parent. The problem is, none of it ever shows up. The error does not show up when setRandomSpeedKart_Check() returns false and the echos don't show up either. Although, I tried manually calling loadAddOns(); and it worked fine.
« Last Edit: August 28, 2014, 10:55:23 AM by jes00 »

Is this code part of an add-on? If yes, the package will be created after this function was called making it useless.

If you're using a gamemode, you should try loadGameModeAddOns instead.

Is this code part of an add-on? If yes, the package will be created after this function was called making it useless.
Oh haha. Duh.

How should I make the error display after all add-ons have been executed then? :/

Package onMissionLoaded(). No args.

If it's important to check the stuff instantly after executing all add-ons, before ui name tables etc. are set up, package createMusicDatablocks or createGameModeMusicDataBlocks. They're called directly after loadAddons or loadGameModeAddons.