Item Rotate not working

Author Topic: Item Rotate not working  (Read 1112 times)

Ok, I made this item rotate script and it won't work for some reason. Here it is.

Code: [Select]
package Itemturn{
Itemdatablock::onspawn(%this);
Rotate = true;
  Parent::onspawn(%this);
 }
};
activatepackage(Itemturn);

Trader wanted me to post this for him, since he is currently banned
Quote
Packages are used to overrides functions / methods.  This package overrides the ItemData::onAdd() method to cause all items to rotate when added.  You could also change ItemData to the datablock of a specific item.


package rotateItems
{
   function ItemData::onAdd(%this,%obj)
   {
      %obj.rotate = 1;
      Parent::onAdd(%this,%obj);
   }
};

Trader wanted me to post this for him, since he is currently banned
Quote
Packages are used to overrides functions / methods.  This package overrides the ItemData::onAdd() method to cause all items to rotate when added.  You could also change ItemData to the datablock of a specific item.


package rotateItems
{
   function ItemData::onAdd(%this,%obj)
   {
      %obj.rotate = 1;
      Parent::onAdd(%this,%obj);
   }
};
Oh, thanks Worm and more thanks to Trader! I didn't know it was onAdd and I needed %obj.

Quote from: Trader
package rotateItems
{
   function ItemData::onAdd(%this,%obj)
   {
      %obj.rotate = 1;
      Parent::onAdd(%this,%obj);
   }
};activatepackage(rotateItems);
Otherwise it won't work...

Quote from: Trader
package rotateItems
{
   function ItemData::onAdd(%this,%obj)
   {
      %obj.rotate = 1;
      Parent::onAdd(%this,%obj);
   }
};activatepackage(rotateItems);
Otherwise it won't work...
Oh wow, I didn't notice that error of Trader's.

Why is Trader banned?

He called someone's mum a whore.

Yeah, I don't know if TheWorm left it off or I forgot to type it, but I definitely intended to put the activate package line.  It was 4am for me, so pretty late.  In any case, I can see from your previous post that you were already aware of activating packages.