PDA

View Full Version : Problem with Mover Script


ncmpinc
18th Apr 2004, 06:10 AM
I've created a Special type of mover, but it doesnt work properly.
With a use trigger it must be toggled between 3 keyframes.


//=============================================================================
// MoverCnt.
//=============================================================================
class MoverCnt extends Mover;

var() byte Value;
Var() Const byte MaxValue;

// Open the mover.
function DoNext()
{
bOpening = true;
bDelaying = false;
Value++;
if (Value>MaxValue) Value=0;
InterpolateTo( KeyNum, MoveTime );
MakeNoise(1.0);
PlaySound( OpeningSound, SLOT_None, SoundVolume / 255.0, false, SoundRadius, SoundPitch / 64.0);
AmbientSound = MoveAmbientSound;
TriggerEvent(OpeningEvent, Self, Instigator);
}


// Toggle when triggered.
state() TriggerNext
{
function Trigger( actor Other, pawn EventInstigator )
{
SavedTrigger = Other;
Instigator = EventInstigator;
if ( SavedTrigger != None )
SavedTrigger.BeginEvent();
GotoState( 'TriggerNext', 'Next' );
}
Next:
if ( DelayTime > 0 )
{
bDelaying = true;
Sleep(DelayTime);
}
DoNext();
FinishInterpolation();
FinishedOpening();
if ( SavedTrigger != None )
SavedTrigger.EndEvent();
Stop;
}

defaultproperties
{
InitialState="TriggerNext"
}

conscripted
31st May 2004, 10:35 PM
you need to put what your problem is. but in the ed, have you sent mover.NumKeys = 3? defaultly, movers have two keysframes, the 0 and 1 (which are set as 1 and, if you want 3 keys, then you have to put 3 in this box.