Author Topic: onAdd not working? [N/A]  (Read 676 times)

Code: [Select]
datablock PlayerData(PlayerCrafting : PlayerStandardArmor)
{
canJet = 0;
canCraft = 1;

uiName = "Crafting Player";
showEnergyBar = false;
};

package CraftAdd
{
function Armor::onAdd(%data,%obj)
{
parent::onAdd(%data,%obj);
if(%data.canCraft)
{
applyDefaultCharacterPrefs(%obj);
talk("found Crafting Player");
}
}
};activatePackage(CraftAdd);
The talk gets called, but the default character prefs part doesn't.
« Last Edit: July 11, 2013, 12:49:00 AM by tommybricksetti »

you could try scheduling the call of 'applyDefaultCharacterPrefs'

Quote
schedule(0, 0, applyDefaultCharacterPrefs, %obj);

Never mind it automatically started working again.
« Last Edit: July 11, 2013, 01:12:45 AM by tommybricksetti »

Never mind it automatically started working again.
These are always the best errors

These are always the best errors
I don't think so, because you never find out what was wrong.

I don't think so, because you never find out what was wrong.
pretty sure that was sarcasm