Is there any way for a mover to go through all the keys available then immediately goes back to the first key?
Thank you
![Smile :)](./images/smilies/icon_smile.gif)
If I move them back, it will loop back, If I understand you correctly. But I want it to go through the keys then goes back immediately.papercoffee wrote: ↑Thu Nov 23, 2023 5:31 pm have you tried to move them back frame for frame?
instead of using only 4 frames you use 7 frames where the last frame is the second frame again... and then it would just go back to the first frame.
But I must say I never tried this my self.
I've seen ones with 2 keyframes, if you use more than two, it'll appear for a frame and goes back, but with two, there's only one way back and it returns immediately.papercoffee wrote: ↑Thu Nov 23, 2023 5:54 pmHow many frames do that mover have?
Oh now I get it ...I think so.
You want the mover to go from start frame to key1, key2 ect. and the immediately back to the start and not go back the whole track.
Uffz ...I think it's possible I might have seen it before. But can't remember in which map.
InterpolateTo( Max(0,KeyNum-1), MoveTime );
InterpolateTo( 0, WhatEverMoveTimeYouWant);
.Code: Select all
class ConstantUTMover expands Mover;
state() ConstantLoop
{
Ignores UnTrigger, Trigger;
function DoOpen()
{
local byte i;
if (bOpening)
{
i = KeyNum + 1;
if (i >= NumKeys)
i = 0;
PlaySound(OpeningSound);
}
else
{
i = PrevKeyNum;
bOpening = true;
PlaySound(ClosingSound);
}
bDelaying = false;
InterpolateTo(i, MoveTime);
AmbientSound = MoveAmbientSound;
}
function InterpolateEnd(actor Other)
{
if (StayOpenTime > 0.f)
AmbientSound = None;
}
function BeginState()
{
if (OtherTime == 0.f)
OtherTime = 1.f;
bOpening = true;
}
function MakeGroupStop()
{
//stop moving immediately
bOpening = false;
AmbientSound = None;
PlaySound(OpenedSound, SLOT_None);
GotoState('', 'Close');
if (Follower != None)
Follower.MakeGroupStop();
}
function MakeGroupReturn()
{
//Abort move and reverse course
bOpening = false;
bInterpolating = false;
GotoState('', 'Open');
if (Follower != None)
Follower.MakeGroupReturn();
}
Begin:
DoOpen();
FinishInterpolation();
FinishedOpening();
Sleep(StayOpenTime);
GoTo'Begin';//loop forever
Open:
GoTo'Begin';
Close:
Sleep(OtherTime);
GoTo'Begin';
}
defaultproperties
{
InitialState="ConstantLoop"
}
Even though I have little bit of knowledge when it comes to programming, I never got into UnrealScript unfortunately. BeyondUnreal looks like a good start but what editor do you guys use?Alien3674 wrote: ↑Thu Nov 23, 2023 11:25 pm The ConstantLoop state from Unreal 227.
Can be used by adding a MyLevel package to the level, or as a separate package.
The code is checked for UT469c.
To be used in MyLevel, you need to delete the top row and the defaultproperties block.Code: Select all
class ConstantUTMover expands Mover; state() ConstantLoop { Ignores UnTrigger, Trigger; function DoOpen() { local byte i; if (bOpening) { i = KeyNum + 1; if (i >= NumKeys) i = 0; PlaySound(OpeningSound); } else { i = PrevKeyNum; bOpening = true; PlaySound(ClosingSound); } bDelaying = false; InterpolateTo(i, MoveTime); AmbientSound = MoveAmbientSound; } function InterpolateEnd(actor Other) { if (StayOpenTime > 0.f) AmbientSound = None; } function BeginState() { if (OtherTime == 0.f) OtherTime = 1.f; bOpening = true; } function MakeGroupStop() { //stop moving immediately bOpening = false; AmbientSound = None; PlaySound(OpenedSound, SLOT_None); GotoState('', 'Close'); if (Follower != None) Follower.MakeGroupStop(); } function MakeGroupReturn() { //Abort move and reverse course bOpening = false; bInterpolating = false; GotoState('', 'Open'); if (Follower != None) Follower.MakeGroupReturn(); } Begin: DoOpen(); FinishInterpolation(); FinishedOpening(); Sleep(StayOpenTime); GoTo'Begin';//loop forever Open: GoTo'Begin'; Close: Sleep(OtherTime); GoTo'Begin'; } defaultproperties { InitialState="ConstantLoop" }
I use a VSCode editor with the UnrealScript extension.UnrealWarrior wrote: ↑Mon Nov 27, 2023 10:46 pmEven though I have little bit of knowledge when it comes to programming, I never got into UnrealScript unfortunately. BeyondUnreal looks like a good start but what editor do you guys use?
Nice! Just what I needed! Thank you! This is gonna make a lot easierAlien3674 wrote: ↑Tue Nov 28, 2023 8:04 pmI use a VSCode editor with the UnrealScript extension.UnrealWarrior wrote: ↑Mon Nov 27, 2023 10:46 pmEven though I have little bit of knowledge when it comes to programming, I never got into UnrealScript unfortunately. BeyondUnreal looks like a good start but what editor do you guys use?
Try to do this: open my test level in the editor with a ready-made movie, open your level without doing anything here.
This script should be available in it, right-click on Add Moder Brush and ConstantUTMover and my test level should be available in this list.
Add a mover and save your level, as long as this mover is present at the level, then the script will remain stored in the level.
But before that, make a backup of your level.