Bridge Commander Central
BC Forums => BC Scripting => Topic started by: ekbalam on September 07, 2009, 02:34:21 PM
-
What I want to accomplish:
I want to be able to trigger the script but not have it run for 10 seconds or 20 seconds. This will give me time to switch to cinematic mode to position the ship for a video capture using FRAPS.
I'm using Patch_R's turn lights off script and have tried adding a "time.wait(10)" which doesn't seem to be recognized, a "time.sleep(10)" which pauses the entire program until the scripts runs (thus making it useless because I cannot switch to cinematic mode until it does) and adding a "while" loop that counts to 10 but BC doesn't like that as the script disappears from Saffi's menu.
What other tricks might I try? :wtf
-
Use this:
Timer1 = MissionLib.CreateTimer(Libs.LibEngineering.GetEngineeringNextEventType(), __name__ + ".function", App.g_kUtopiaModule.GetGameTime() + X, 0, 0)
Just replace X with the desired delay and "function" with the function that you want to call once the time is up, in this case it's "light".
-
You are the man! It's not exactly what I had intended. But it actually works out better.
Bitchin', thanks! :dance
-
A light weight approach would be to use a TGScriptAction_Create("module", "function") combined with TGSequence_Create() and pSequence.AddAction(theTGScriptAction, delay in half seconds) and then pSequence.Play()