How to properly display messages about unlocking Special Operations missions

Have modding questions or discovered something new? Post here.
Post Reply
User avatar
Secg
Half Track L2
Half Track L2
Posts: 200
Joined: Sat Jun 10, 2017 12:28 am
United States of America

How to properly display messages about unlocking Special Operations missions

Post by Secg »

Greetings, Extreme Fighters!

It am I, Secg, again!

I'm finishing my Heroic 1.01 Mod, which will contain all Campaign Missions, Great Battles Missions, Special Operations Missions, & almost all Multiplayer Missions (except 2dumdums).

The only trouble I'm having now is that after earning Gold Medals to unlock Special Operations missions, I always received messages saying "You have unlocked [1,2] Great Battles Mission[s]" :o .

Anyone knows how to code so that the "You have unlocked [1,2] Special Operations Mission[s]" shall be properly displayed?

Thanks before hand!
ImageImage
User avatar
TommyCD1
Moderator
Moderator
Posts: 1146
Joined: Tue Jun 04, 2013 8:55 am
Location: East Coast
Contact:
United States of America

Re: How to properly display messages about unlocking Special Operations missions

Post by TommyCD1 »

I am not 100% certain, since I simply ported Special Operations over and had functionality natively, but I believe unlocking conditions define whether the unlocked "thing" is an intel file, great battle, or special op.

If you're using the group.cfg file, then the unlocking condition looks like this.

Code: Select all

  UnlockingGroup()
  {
    Missions()
    {
      Add("S15");
    }
    Medal(2);
    Unlock("file.77", 0);
  }

  UnlockingGroup()
  {
    Missions()
    {
      Add("S01");
      Add("S02");
      Add("S03");
      Add("S04");
      Add("S05");
    }
    Medal(0);
    Unlock("mission.so.1", 2);
  }

  UnlockingGroup()
  {
    Missions()
    {
      Add("S01");
      Add("S02");
      Add("S03");
      Add("S04");
      Add("S05");
    }
    Medal(1);
    Unlock("mission.gb.5", 1);
  }
As you can see, an UnlockingGroup() determines what to unlock using the Unlock() function located within. The Unlock() function accepts two parameters, a string which is used to determine the ID of what is being unlocked, and an integer which I believe is used to determine the kind of "thing" being unlocked. 0 being an intel file, 1 being a great battle, and 2 being a special op.

If you're using the debriefing.cfg file within a specific mission itself, then the unlocking block is standalone and looks like this.

Code: Select all

Unlocking()
{
  Add(0, "file.7", 0);
  Add(1, "file.41", 0);
  Add(2, "mission.so.1", 2);
}
Here, the Add() function accepts three parameters, first an integer that corresponds to which medal will earn a reward. 0 is bronze, 1 is silver, and 2 is gold. The next two parameters are identical to before, the ID and the "thing" integer.

Keep in mind the "thing" being unlocked is localized as intel files, great battles, and special ops accordingly. I don't know what any numbers beyond 2 will do, if anything at all, but you won't be able to have a custom display message, such as "Unlocked 2 Custom Missions" or anything like that. In fact, the message displayed can have no correlation to what is actually unlocked.

As well, in the vanilla game, only Great Battles are intended to ever be unlocked. As such, the notification only has one display slot for use, and certain unlocks will override others, such as intel files being prioritized over great battles. This functionality was added pretty much from scratch in my Custom Campaigns \ Missions Add-on Support mod though. If you'd like to use only that, such as if what you are making is a total conversion mod, then feel free. Here's the vanilla debriefing code with the modified unlocking window I created. It should work as is, but let me know if it doesn't.
Attachments
unlocking.zip
(6.47 KiB) Downloaded 107 times
unlocking.zip
(6.47 KiB) Downloaded 107 times
I may not make the best maps, or be the best player, but I put a lot of time, effort, and care into my stuff. That counts for something, right? No.
Image
"Can we order a pizza?"
GameRanger ID: 913974
User avatar
Secg
Half Track L2
Half Track L2
Posts: 200
Joined: Sat Jun 10, 2017 12:28 am
United States of America

Re: How to properly display messages about unlocking Special Operations missions

Post by Secg »

Helpful as always, TommyCD1!

Many thanks!
ImageImage
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests