State labels in the middle of statements
Posted: Sun Jun 12, 2022 5:06 am
I'm looking at the exported ScriptedPawn source and I see that it seems to have state labels in the middle of the if/else statements.
Is this some sort of corruption of the scripts stored within the package files (perhaps due to size?), or is this a genuinely supported syntax?
I can't really make out how it's valid though, since it seems to intersect the if/else statements in arbitrary places and leaves them "unclosed" under some conditions under some labels.
Below is a small example of where it first appears within ScriptedPawn's Patrolling state.
Is this a known issue? It seems to be present even in older sources.
Is this some sort of corruption of the scripts stored within the package files (perhaps due to size?), or is this a genuinely supported syntax?
I can't really make out how it's valid though, since it seems to intersect the if/else statements in arbitrary places and leaves them "unclosed" under some conditions under some labels.
Below is a small example of where it first appears within ScriptedPawn's Patrolling state.
Is this a known issue? It seems to be present even in older sources.
Code: Select all
Begin:
sleep(0.1);
Patrol: //FIXME -add stasis mode? - also set random start point in roam area
WaitForLanding();
FindNextPatrol();
Disable('AnimEnd');
if (PatrolPoint(OrderObject) != None)
{
////log("Move to next patrol point");
if ( !bQuiet && (FRand() < 0.4) )
PlayRoamingSound();
TweenToWalking(0.3);
FinishAnim();
PlayWalking();
numHuntPaths = 0;
MoveToPatrol:
if (actorReachable(OrderObject))
MoveToward(OrderObject, WalkingSpeed);
else
{
PickDestination();
if (OrderObject != None)
{
SpecialNavig:
if (SpecialPause > 0.0)
{
Acceleration = vect(0,0,0);
TweenToPatrolStop(0.3);
Sleep(SpecialPause);
SpecialPause = 0.0;
TweenToWalking(0.1);
FinishAnim();
PlayWalking();
}
numHuntPaths++;
MoveToward(MoveTarget, WalkingSpeed);
if ( numHuntPaths < 30 )
Goto('MoveToPatrol');
else
Goto('GiveUp');
}
else
Goto('GiveUp');
}
ReachedPatrol:
////log("Got to patrol point "$OrderTag);
OrderTag = Patrolpoint(OrderObject).Nextpatrol;
////log("Next patrol point "$OrderTag);
if ( Patrolpoint(OrderObject).pausetime > 0.0 )
{
////log("Pause patrol");
Acceleration = vect(0,0,0);
TweenToFighter(0.2);