Author Topic: Trigger Loop is not Looping  (Read 621 times)

Well pretty much then trigger works perfectly except it only adds to the varible rads every time the player touches the brick, when it needs to add every certain amount of MS
Code: [Select]
datablock fxDTSBrickData(RadiationBrickData : brick2x4FData)
{
category = "FalloutRP";
subCategory = "Wasteland Brick";

uiName = "Radiation Zone Minor";

triggerDatablock = RADZoneInputTriggerData;
triggerSize = "32 32 15";
trigger = 0;
};
//Loading Junk-_-
package Start
{

function gameConnection::onClientEnterGame(%client)
{
%client.Radsuit = 0;
Parent::onClientEnterGame(%client);

}

};
activatePackage(Start);
//trigger!

datablock TriggerData(RadiationBrickTriggerData)
{
tickPeriodMS = 100;
};

function RadiationBrickData::onPlant(%this, %obj)
{
%obj.createTrigger(RadiationBrickTriggerData);
}

function RadiationBrickTriggerData::onEnterTrigger(%this, %client, %trigger, %obj)
{

%count = clientGroup.getCount();

for(%i = 0; %i < %count; %i++)
{
%client = clientGroup.getObject(%i);

if(%client.Radsuit > 0)
%client.Radiation += 1;

else
%client.Radiation +=2;
}
$RadLoop = schedule(1000, 0, RadLoop);

}

function serverCmdyes(%client)
{
echo(%client.Radiation);
}

function FxDTSBrick::createTrigger(%this, %data)
{
%t = new Trigger()
{
datablock = %data;
polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1"; //this determines the shape of the trigger
};
missionCleanup.add(%t);
%boxMax = getWords(%this.getWorldBox(), 3, 5);
%boxMin = getWords(%this.getWorldBox(), 0, 2);
%boxDiff = vectorSub(%boxMax,%boxMin);
%boxDiff = vectorAdd(%boxDiff, "0 0 0.2");
%t.setScale(%boxDiff);
%posA = %this.getWorldBoxCenter();
%posB = %t.getWorldBoxCenter();
%posDiff = vectorSub(%posA, %posB);
%posDiff = vectorAdd(%posDiff, "0 0 0.1");
%t.setTransform(%posDiff);
%this.trigger = %t;
%t.brick = %this;
return %t;
}

$RadLoop = schedule(1000, 0, RadLoop);
where do you define the function radLoop?

$RadLoop = schedule(1000, 0, RadLoop);
where do you define the function radLoop?
Well that was a fail, sorry
EDIT: I edited it to

Code: [Select]
$RadLoop = schedule(1000, 0, RadiationBrickTriggerData);but still no luck
« Last Edit: July 06, 2015, 12:54:43 AM by SuperFlaminninja³ »

RadiationBrickTriggerData isn't a function, it's a datablock.

try using the tick trigger function

Code: [Select]
function triggerName::onTickTrigger(%this,%trigger,%pl)
{
parent::onTickTrigger(%this,%trigger,%pl);
%pl.rads++;
}

%pl is whatever player was standing in the trigger when it hits its 'tick' which you have set at every 100 ms