Originally Posted by
OBT~Polak
Thank you for your response Rostic
,
When will the message appear, is it a trigger that does it?
For example, I would like to display a message 1 minute after the start of a multiplayer mission to indicate to pilots where an enemy formation is located, in order to recreate the information received by radio by the pilots.
Sounds like you need to go through any beginners guide to C# and TFS should finally made a manual to mission scripting
You should not expect that all players will be on the server 1 minuter after restart, due to usually most players making a short break. You better do it 1 minuter after player took off. Use event "OnAircraftTookOff(int missionNumber, string shortName, AiAircraft aircraft)" but make sure to check that there is a player in aircraft (no AI). Also probably this will not work in case of airspawn. Also there is an event OnPlaceEnter(Player player, AiActor actor, int placeIndex) but that happens any time player change his place in any multycrew aircraft.
Sorry, I do not have time to write full script. Here is example how to execute anything by timeout in mission where ever you want it (in this example it is OnBattleStarted event):
Code:
public override void OnBattleStarted()
{
base.OnBattleStarted();
/////////////////////////////////////
// write mission custom code below
// 15 - is seconds
Timeout(15, () =>
{
AnyFunctionYouWantToRun();
});
// write mission custom code above
/////////////////////////////////////
// listen all the mission
MissionNumberListener = -1;
}
public void AnyFunctionYouWantToRun() {
// write your code here
}
One more example (not exactly what you want, but may work some times):
Code:
public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
{
base.OnPlaceEnter(player, actor, placeIndex);
/////////////////////////////////////
// write mission custom code below
Player[] recepients = { player };
Timeout(60, () =>
{
GamePlay.gpHUDLogCenter(recepients, "Blah blah blah!");
});
// write mission custom code above
/////////////////////////////////////
}
Bookmarks