//deathstar2battle_b state Base { Conditions { } Actions { SetState "Update" } } state Update { Conditions { if Message "OpenedBigDoor" == 0 and if EitherPlayerInTriggerArea "End" == 1 goto OpenBigDoor //Think about spawning general spline followers. if Timer > 3 and if NumInSetAlive "1" < 15 goto SpawnOnSpline } Actions { ResetTimer "mintime=0" "maxtime=2" } } state OpenBigDoor { Conditions { } Actions { SetMessage "name=OpenedBigDoor" "value=1" UnLockDoor "bigdoor" OpenDoor "bigdoor" "stayopen" SetState "Update" } } /////////// state SpawnOnSpline { Conditions { if Random < 0.5 goto Spawn_1 //if PreviousResult < 0.5 goto Spawn_2 if AlwaysTrue == 1 goto Spawn_Back //if AlwaysTrue == 1 goto Spawn_Back2 } Actions { } } state Spawn_1 { Conditions { } Actions { CreateSplineCreatures "type=tiefighter" "type=tieinterceptor" "splines=ai" "script=spline_tie" "y_offset=-1.5f" "distance=-200" "relative_to_player" SetState "Update" } } state Spawn_2 { Conditions { } Actions { SelectRandomSpline "splines=ai" CreateSplineCreatures "type=tiefighter" "type=tieinterceptor" "use_selected_spline" "script=spline_tie" "y_offset=-1.5f" "distance=-200" "relative_to_player" CreateSplineCreatures "type=tiefighter" "type=tieinterceptor" "use_selected_spline" "script=spline_tie" "y_offset=1.5f" "distance=-200" "relative_to_player" SetState "Update" } } state Spawn_Back { Conditions { } Actions { SelectRandomSpline "splines=ai" CreateSplineCreatures "type=tiefighter" "type=tieinterceptor" "use_selected_spline" "script=spline_backward" "y_offset=1.5f" "x_offset=1.5f" "distance=100" "relative_to_player" SetState "Update" } } state Spawn_Back2 { Conditions { } Actions { SelectRandomSpline "splines=ai" CreateSplineCreatures "type=tiefighter" "type=tieinterceptor" "use_selected_spline" "script=spline_backward" "y_offset=-1.5f" "distance=100" "relative_to_player" CreateSplineCreatures "type=tiefighter" "type=tieinterceptor" "use_selected_spline" "script=spline_backward" "y_offset=1.5f" "distance=100" "relative_to_player" SetState "Update" } }