Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-07-2011, 11:37 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default Custom ingame menus introduced

Now you can include any custom menu into your mission for players to use. See code example from naryv below.

The menu is called by pressing <Tab> +<4>

I am thinking about some usage examples. I assume it allows for instance:
- assign new waypoints to AI
- request fighter support
- request bomber missions
- report recon mission results over recon target
- spot enemy units, sending their pos to MP chat
- vote for commander and officers in MP missions
- allow officers to select next target, mission type, etc. for a side in MP
- get any other feedback from players that a mission script may need

Post your ideas below please

Code:
using System;
using System.Collections;
using maddox.game;
using maddox.game.world;

public class Mission : AMission {

  private void setMainMenu( Player player ) {
    GamePlay.gpSetOrderMissionMenu( player, false, 0, new string[] { "1", "2", "3" }, new bool[] { true, false, false } );
  }
  private void setSubMenu( Player player ) {
    GamePlay.gpSetOrderMissionMenu( player, true, 1, new string[] { "1-1", "1-2", "1-3" }, new bool[] { false, false, false } );
  }

  public override void OnOrderMissionMenuSelected( Player player, int ID, int menuItemIndex ) {
    if( ID == 0 ) { // main menu
      if( menuItemIndex == 1 ) {
          GamePlay.gpHUDLogCenter("Menu selected Loading mission aaa2.mis");
          GamePlay.gpPostMissionLoad("missions\\aaa2.mis");
          setSubMenu( player );
      }
    } else if( ID == 1 ) { // sub menu
      setMainMenu( player );
    }
  }

  public override void OnPlayerConnected( Player player ) {
    if( MissionNumber == 0 ) {
      setMainMenu( player );
    }
  }

  public override void Inited() {
    if( MissionNumber == 0 ) {
      setMainMenu(GamePlay.gpPlayer());
    }
  }
}
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:56 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.