Author Topic: Item rotation doesn't work?  (Read 1083 times)

I set "rotate" in the item data section to 'true'. After spawning it: it doesn't rotate.

Am I missing something?

Lots of things on items are broken I've found out. The setCollisionTimeout doesn't do anything as well as some other functions.
I tried the rotating like you did and it did nothing. If you really want it, you could possibly do it manually just by setting the rotation. It's pretty easy if you want an explanation.

Lots of things on items are broken I've found out. The setCollisionTimeout doesn't do anything as well as some other functions.
I tried the rotating like you did and it did nothing. If you really want it, you could possibly do it manually just by setting the rotation. It's pretty easy if you want an explanation.
Yet it works for T+T ammo, when spawned it starts spinning.

Might as well, seeing as I can't get it to work right. Shoot.

Lots of things on items are broken I've found out. The setCollisionTimeout doesn't do anything as well as some other functions.
I tried the rotating like you did and it did nothing. If you really want it, you could possibly do it manually just by setting the rotation. It's pretty easy if you want an explanation.


I don't know if this is a default method or not but try:

Code: [Select]
itemData.applyRotating();
« Last Edit: February 20, 2013, 12:26:04 AM by Eepos2 »

Code: [Select]
itemData.applyRotating();
Did a dump of hammerItem, I don't see this?

Did a dump of hammerItem, I don't see this?

Oh, haha it's not a default method, I remember seeing it when I dumped an item once and I thought it was default.

Open up the Slayer CTF script and look at the SlayerCTF_FlagItem::onAdd code.

Open up the Slayer CTF script and look at the SlayerCTF_FlagItem::onAdd code.
Yes, and just because it's 12:35am and I don't want to go to bed...
Straight from the T+T Package Tier 1 code, just do this for whatever item you need:
Code: [Select]
function ammoDroppedItem::onAdd(%this, %obj)
{
%obj.rotate = true;
Parent::onAdd(%this, %obj);
}

EDIT: Does anyone know why you have to do this in onAdd and it doesn't work when you set it in the datablock or you set it later to true?
« Last Edit: February 20, 2013, 12:42:07 AM by DYLANzzz »

Code: [Select]
function namehereItem::onAdd(%this, %obj)
{
%obj.rotate = true;
Parent::onAdd(%this, %obj);
}

This worked for me. Thanks you guys. c:

Code: [Select]
function ammoDroppedItem::onAdd(%this, %obj)
{
%obj.rotate = true;
Parent::onAdd(%this, %obj);
}
Yes, that's the code I wanted to get, I just didn't have time then. Thanks.

EDIT: Does anyone know why you have to do this in onAdd and it doesn't work when you set it in the datablock or you set it later to true?
It's because it isn't a datablock value, so it doesn't do anything there. It has to be defined while the item is being created, so it only works when you place it before the ::onAdd parent.

The setCollisionTimeout doesn't do anything as well as some other functions.
This is actually used when dropping items so they aren't immediately collected again as the player tosses them away. The argument is the player that shouldn't collide with the item.


I though this was an add-on and not a default thing? http://forum.returntoblockland.com/dlm/viewFile.php?id=1036
It's an add-on that turns on a default thing that's never used in the vanilla game.

This is actually used when dropping items so they aren't immediately collected again as the player tosses them away. The argument is the player that shouldn't collide with the item.
I see
I tried calling this at another time as you said with the player object (had an item with canPickup set to false) and the item still collided with me so i figured it was broken?

I see
I tried calling this at another time as you said with the player object (had an item with canPickup set to false) and the item still collided with me so i figured it was broken?
The delay is very short, like less than a second. Same amount of time it takes to drop an item straight down onto the floor and have it return to your inventory.