Game Development Community

Stop Items Rotating...

by Quinton Delpeche · in Game Mechanics Kit · 03/26/2012 (10:48 am) · 3 replies

I have tried to stop the items being dropped by the bots rotating ... but to no avail.

datablock ItemData(HealthPatch)
{
 ...
    rotate = false;
 ...
};

I even tried to do it here

function InventoryItemData::create(%data)
{
    %obj = new Item()
    {
     ...
        rotate = false;
     ...
    };
    return %obj;
}

Any ideas. I replaced the Health Pack object with another model and everything works fine ... except for stopping the rotation.

Arrrrrggghhhh ... help please.

About the author

Gobbo Games is an Independent Games Development company operating from Durban in South Africa. We believe in creating high-quality cost-effective games that remain true to the belief of Independent Game Developers around the world.


#1
06/24/2012 (4:42 pm)
I wouldn't mind finding an answer to this either! Rotating items are so 1990's... :-P

Have you managed to find a solution ?
#2
06/24/2012 (8:58 pm)
@Richard: Yes I did come right ... it was eventually a matter of running debug statements in the scripts until I found the right place to put the call in.

scripts/server/item.cs
function ItemData::createItem(%data)
{    
    %obj = new Item()
    {
        dataBlock = %data;
        static = true;
        rotate = false;
    };
    return %obj;
}

In my instance I am using the GMK (Game Mechanics Kit) so I had to add it to: scripts/server/logickingMechanics/inventoryItem.cs
function InventoryItemData::create(%data)
{
    %obj = new Item()
    {
        class = "InventoryItem";
        dataBlock = %data;
        rotate = %data.rotate;
        static = %data.static;
        takeOnUse = %data.takeOnUse;
    };

    return %obj;
}

As I recall, it comes down to the rotate = false and static = true options.

I hope this helps.
#3
06/25/2012 (5:33 am)
Nice - thanks for that.
The way Torque manages items in general (particularly physical orientation and placement) is a bit fiddly...