Game Development Community

Grenade help

by Ironbelly Studios · in General Discussion · 09/01/2008 (2:52 am) · 1 replies

I have grenade resource , but player first bites the pin out and then throw the grenade.Currently player just throw the grenade and this become explodes.What i should to do for bites the pin out.?????

#1
09/02/2008 (3:20 am)
When i am going to throw the item by keybinding this is happening well.But when i am doing this by left mouse clik this is giving an error.I modified the code as...

1. in default.bind.cs i added

moveMap.bindCmd(mouse, "button0","commandToServer(\'Crossbowdrop\',\"Crossbow\");", "");

2. In inventory.cs i added this function

function serverCmdCrossbowdrop(%client,%data)
{

%client.getControlObject().throw(%data);
}

3. but in inventory.cs file in the function

function ShapeBase::throw(%this,%data,%amount)
{
// Throw objects from inventory. The onThrow method is
// responsible for decrementing the inventory.
if (%this.getInventory(%data) > 0) {
%obj = %data.onThrow(%this,%amount); ////////// The object is not creating /////

if (%obj) {
%this.throwObject(%obj);
return true;
}
}
return false;
}

%obj did not create.Thats why some other function is not performing.
But when i am doing it by keyboard binding this is happening well.

What is the problem...