Need help with code to tell a Decoration, that when grabbed, to move up/rise vertically a set number of units, and then when Grabbed again it lowers back to its starting position.
This could be done with a standard toggle trigger mover, but I have very specific reasons not to use a normal mover.
It just needs to move vertically. Would be nice to have the move speed and height adjustable in the editor properties.
After looking at the Inf Turret Decoration code, I think something like the following script would work to detect the Grab.
Now I just need to know how to go about changing the height.
This could be done with a standard toggle trigger mover, but I have very specific reasons not to use a normal mover.
It just needs to move vertically. Would be nice to have the move speed and height adjustable in the editor properties.
After looking at the Inf Turret Decoration code, I think something like the following script would work to detect the Grab.
Now I just need to know how to go about changing the height.
Code:
function Grab( actor Other, pawn EventInstigator )
{
if ( Other.IsInState('Dying') || Other.IsInState('PlayerSpectating') || Other.bHidden )
return;
if (Pawn(Other) == None)
return;
if ( !Pawn(Other).bIsPlayer )
return;
if ( !bOPened
|| ( PlayerPawn(Other) != None)
)
{
bOPened = True;
GotoState( 'openmesh' ); //Needs to tell decoration to rise up to its variable set open height position
}
else if ( bOPened
|| ( PlayerPawn(Other) != None)
)
{
bOPened = False;
GotoState( 'Closemesh' ); //Needs to tell decoration to lower back to its default start position.
}
}