I am just creating an item that when the projectile collides with a door, it opens the door. I just have a few questions.
1. Can you just make it so it triggers the output event?
2. Do I need to add the doorOpen output event function from the JVS script?
Here is my code as of now:
function OpenProjectile::OnCollision(%this, %target)
{
%target = $typeMasks::fxDtsBrickAlwaysObjectType;
if(!isObject(%target))
{
messageClient(%client, '', "\c6You must use this on a door.");
return;
}
if(%target.category $= "JVS")
{
processOutputEvent(doorOpen);
}
}
Here is the code from JVS:
function fxDTSBrick::doorOpen(%obj,%openType,%openDir,%text,%client)
{
%doorID = %obj.doorID();
%direction[0] = "CW";
%direction[1] = "CCW";
%direction = %direction[%openDir];
if(%openType < DoorRestrictionsSO.numRestrictions && (%direction $= "CCW" || %direction $= "CW") && %doorID > -1)
{
%obj.doorCheck();
%permitted = -1;
if(%openType == 0)
{
%permitted = 1;
}
else
{
%action = "OPEN";
eval("%permitted = %obj." @ DoorRestrictionsSO.restrictionMethod[%openType] @ "(%action,%direction,%text,%client);");
}
if(%permitted == 1)
{
%obj.doorPermittedUse(%client,0,"OPEN",%direction);
}
else if(%permitted == 0)
{
%obj.onDoorRestricted(%client);
}
}
}
Do I need to implement the JVS function in my script? Or how can I just trigger the doorOpen output event?