Author Topic: Package Doesn't Work [Solved]  (Read 1042 times)

I am completely blown away that this does not work.
Code: [Select]
package PhysicsJump
{
function Armor::onTrigger(%data,%obj,%slot,%val)
{
Parent::onTrigger(%data,%obj,%slot,%val);
if(%slot == 2)
{
talk("onJump called");
%obj.isSpacing = %val;
if(%obj.isSpacing && %data.canPhysicsJump)
{
%obj.schedule(100,startPhysicsJumping);
}
}
}
};activatePackage(PhysicsJump);
The talk(); isn't even called. I have no clue what's going on.
« Last Edit: April 10, 2013, 01:13:25 PM by tommybricksetti »

Are you getting a syntax error, or is this just not working?

Edit: try changing if(%slot == 2) to if(%slot == 1) - Nope don't try this.
« Last Edit: April 10, 2013, 09:49:41 AM by Honorabl3 »

No syntax errors. The package loads, but it does not recognize that the Jump key is being pressed. Could it be some other package I have in another script? And if so why when I'm pretty sure they all have parents?

Put a check before the if(%slot == 2). Tell me if it gets called. Also try remodifying the argument.

package PhysicsJump
{
   function Armor::onTrigger(%data,%obj,%slot,%val)
   {
      Parent::onTrigger(%data,%obj,%slot,%val);
      talk("onJump called - Part A");
      if(%slot == 2 && %val)
      {
         talk("onJump called - Part B");
         %obj.isSpacing = %val;
         if(%obj.isSpacing && %data.canPhysicsJump)
         {
            %obj.schedule(100,startPhysicsJumping);
         }
      }
   }
};
ActivatePackage(PhysicsJump);
« Last Edit: April 10, 2013, 09:58:07 AM by Honorabl3 »

I just tried it with only default add-ons and it worked perfectly. Now I just need to figure out which add-on was breaking it.


It was another package that was overriding it.

What mod was the package from?


One that he created.
The one that was overriding it I mean.

The one that was overriding it I mean.
Yes. He had another add-on that he made, overriding it.