Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Show Briefing - A Config Script for Wargus.

17 459 bytes Raw Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- Show the briefing before the map is loaded.
function ShowBriefing(title,objectives,interface,text,music)
  -- Required files needs to be accessed.
  if (CanAccessFile(interface) and CanAccessFile(text) and CanAccessFile(music)) then
    
      Briefing(
          title,
          objectives,
          interface,
          text,
          {music}
      )
  -- else just specify the objectives
  else
      Objectives = objectives
  end
end
Have you ever wanted to make a briefing of your custom WarCraft II map to explain the player what is about the map and the objectives to complete? In Wargus this is possible, and I have written a script that avoids possible crashes when the built-in function Briefing is called.

The function I have written is called ShowBriefing, as the name suggest, it shows the briefing of the map but with some checks related to the interface, text to show and music in the briefing.

The function requires 5 arguments:

  1. The title of the briefing. A single string that is show at the top of the screen.
  2. The objectives of the map. A list of strings that will show the objectives that the players has to complete. Be aware that this doesn't set the objectives of the map, since those are set through triggers.
  3. The interface, or simply the background image. This is a single string that has the path to an image to use as a background.
  4. The text to show during the briefing. This one is also a string that contains a path to a file, generally a .txt file, where it contains the text to appear on the screen.
  5. The music to play in background. This argument can be a single string or a list of strings, each one containing a path to the music to play in background.
Suppose you have your custom map in a folder with also the background interface, briefing text and music to play and you want to show the briefing before the map then you have to add the function in your map scripts and then you call the function by passing the values like in this example:

-- function declaration

the_title = "TITLE"
the_objectives = {"- Build a barracks", "- Build 4 farms."}
the_interface = "background.png"
the_text = "mission.txt"
the_music = {"Human Music.ogg"}

ShowBriefing(the_title, the_objectives, the_interface, the_text, the_music)


No comments yet