Author Topic: Fixing the lockpick  (Read 358 times)

Wondering if anyone can fix this, I have tried some stuff but can't get it. I know about the DoorOpen and Close stuff, and I know I have to replace it but I'm still learning to Torque and trying to understand, perhaps you guys can help me?

Here's the code to it.
Code: [Select]
// ============================================================
// Section 2 : Functions
// ============================================================

// Section 2.1 : Visual Functionality
function CityRPGPicklockImage::onPreFire(%this, %obj, %slot)
{
%obj.playThread(2, "armAttack");
}

function CityRPGPicklockImage::onStopFire(%this, %obj, %slot)
{
%obj.playThread(2, "root");
}

function CityRPGPicklockImage::onHitObject(%this, %obj, %slot, %col, %pos, %normal)
{
if(%col.getType() & $TypeMasks::FxBrickObjectType)
{
%client = %obj.client;
%brickData = %col.getDatablock();
if(isObject(%col.door) && %col.door.closed)
{
if(getRandom(0, 3) > 2)
{
for(%i = 0; %col.eventInput[%i] !$= "" && !%doorPath; %i++)
{
if(%col.eventOutput[%i] $= "doorOpen")
%doorPath = %col.eventOutputParameter[%i, 2];
}

switch(%doorPath)
{
case 0: %doorResult = %col.doorOpenCW();
case 1: %doorResult = %col.doorOpenCCW();
default: %doorResult = %col.doorOpen();
}

%col.schedule(3000, "doorClose");

if(%doorResult == 1)
{
%col.schedule(3000, "doorClose");

I think thats what needs to be fixed. (Yes I have searched but I don't understand the other posts.)

3rd post in a week about the god damn lockpick.

Holy stuff, just noticed another topic got bumped, sorry Ban-the-Man. Locking.