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
  #4  
Old 09-26-2011, 11:23 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

You can add this code to a script:

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


public class Mission : AMission
{

    private void setMainMenu(Player player)
    {
        GamePlay.gpSetOrderMissionMenu(player, false, 0, new string[] { "Start Airgroup Engines" }, new bool[] { true });
    }

    public override void OnOrderMissionMenuSelected(Player player, int ID, int menuItemIndex)
    {
        base.OnOrderMissionMenuSelected(player, ID, menuItemIndex);

        if (ID == 0) // main menu
        {
            if (menuItemIndex == 1)  // Start Airgroup Engines
            {
                GamePlay.gpLogServer(null, "Start Engines", null); // Controlmessage
                GamePlay.gpPlayer().Place().Group().Idle = false;
            }
        }
    }


    public override void Inited()
    {
        setMainMenu(GamePlay.gpPlayer());
    }
    
    
    public override void OnBattleStarted()
    {
        base.OnBattleStarted();

        MissionNumberListener = -1;

        GamePlay.gpPlayer().Place().Group().Idle = true;
    }
}
With this you can give a "Start Airgroup Engines" - Command via the communication menu. 4.Mission -> 1. Start Airgroup Engines.

Little Explanation with
GamePlay.gpPlayer().Place().Group().Idle you can set the player Airgroup to Idle (true) or active (false).
So at the beginning i set the player airgroup to idle (true).
And add a entry to the mission menu, so the player can activate the airgroup manually.

This Script works in singleplayer and with actual beta (needs GamePlay.gpSetOrderMissionMenu and OnOrderMissionMenuSelected(..) ).

Last edited by FG28_Kodiak; 09-26-2011 at 11:35 AM.
Reply With Quote
 


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 09:26 AM.


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