The Fighting 99th Air Wing

AIR : LAND : SEA : FIGHT!

On Birth Message - How To

2 years 11 months ago 2 years 11 months ago by TracerFacer.
TracerFacer
Administrator
Administrator
Posts: 16
Karma: 1
More
Topic Author
On Birth Message - How To #9560
When a new player joins a DCS Multiplayer game it can be very confusing on what they are expected to do. I like to add a briefing when a player enters a new aircraft. This is also a good place to add a mission status msg. Attached is an example .lua file to that end.

Add this script via a ONE TIME "DO SCRIPT FILE" in the mission editor.

Edit this file to suit your needs. It's pretty self explanatory. Just modify the text between the quotes (" ")

Some missions use smoke, some don't. Remember to comment out the smoke section and remove the smoke msg from the last portion of the file.
onEngineStart = {} 
function onEngineStart:onEvent(event)

	if world.event.S_EVENT_BIRTH == event.id and event.initiator:getPlayerName() ~= nil then 
		local playerGroup = event.initiator:getGroup()
		local playerUnit = playerGroup:getUnit(1)
		local playerName = playerUnit:getPlayerName()
		local playerSide = playerGroup:getCoalition()
		local playerID = playerGroup:getID()
		local playerAircraft = playerUnit:getTypeName()
		
   
		local MissionName = 
		"======[ Fighting 99th - Battle of Gori ]======" 
		
		local TeamSpeak = 
		"Please join our TeamSpeak server @ teamspeak.f99th.com for improved comms and a better mission experience!"

		local ObjectiveRed = 
		"===============[ MISSION OBJECTIVE ]==============\n" ..
		"CAP - Keep skies over Gori clear of NATO aircraft.\n\n"


		local ObjectiveBlue = 
		"===============[ MISSION OBJECTIVE ]==============\n" ..
		"CAP - Control the airspace above the Gori Valley. Protect CAS and HELO aircraft as the attempt to destroy artillery positions and retrieve medvacs from the city.\n\n" ..
		"CAS - Destroy Russian AAA and artillery units surrounding the City of Gori. Clear a path for helo operations as they attempt to rescue our people. Leave no one behind!\n\n" ..
		"HELO - CAS and AFAC Helos are available. Fly to the town of Gori, land near the blue smoke zones. Use CDLD F10 Menu to pick up MEDVACS. Fly to the green smoke and unload the troops using the same menu.\n\n"
		
		local SmokeZones = 
		"=================[ SMOKE ZONES ]================\n" ..
		"RED SMOKE  :  AFAC Targets for CAS.\n" ..
		"BLUE SMOKE :  PICKUP MEDEVACS FROM THIS LOCATION.\n" ..
		"GREEN SMOKE:  RETURN MEDEVACS TO THIS LOCATION.\n\n" 
		
		local EndBrief = "===============[ END MISSION BRIEF ]==============\n\n"

		-- Send appropriate message to each coalition.
		if playerSide == coalition.side.BLUE then --blue team
		
			trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n"  .. TeamSpeak .. "\n\n" .. ObjectiveBlue .. SmokeZones .. EndBrief, 120)
		end	
		if playerSide == coalition.side.RED then -- red team
			
			trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n"  .. TeamSpeak .. "\n\n" .. ObjectiveRed .. EndBrief, 120)
		end
	end
end

world.addEventHandler(onEngineStart)


If you are not using smoke comment out this section
local SmokeZones = 
		"=================[ SMOKE ZONES ]================\n" ..
		"RED SMOKE  :  AFAC Targets for CAS.\n" ..
		"BLUE SMOKE :  PICKUP MEDEVACS FROM THIS LOCATION.\n" ..
		"GREEN SMOKE:  RETURN MEDEVACS TO THIS LOCATION.\n\n" 

And change the trigger action sections from this section:
trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n"  .. TeamSpeak .. "\n\n" .. ObjectiveBlue .. SmokeZones .. EndBrief, 120)

To this: (note the removal of the SmokeZones .. portion
trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n"  .. TeamSpeak .. "\n\n" .. ObjectiveBlue .. EndBrief, 120)

The 120 at the end of the trigger.action is the number of seconds you would like the briefing displayed. I think 2 mins is good enough and does not interrupt aircraft startup.

If you have any questions or comments you can post them here or hit me up in TeamSpeak or Discord.
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.047 seconds