![]() |
|
|
|
#1
|
|||
|
|||
|
cheers for this - looks useful- and the explanation even more so
|
|
#2
|
|||
|
|||
|
Hi Kodiak,
Do I need more code to get the communication menu. 4.Mission option to work? I see it but it's greyed out . On further exploration it works when used as a single script it's when I add it to a script already created it doesn't so I guess it's a problem with how I'm attaching it Last edited by Punch_145; 12-09-2012 at 11:53 AM. Reason: Added |
|
#3
|
|||
|
|||
|
This is what I have
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
public override void OnBattleStarted()
{
base.OnBattleStarted();
GamePlay.gpHUDLogCenter("Welcome to TP Night");
}
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
if ("WinCondition1".Equals(shortName) && active)
{
GamePlay.gpHUDLogCenter("Mission Success !");
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}
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;
}
}
|
|
#4
|
|||
|
|||
|
Sorted.................realized the "public override void OnBattleStarted()" section of your script needs to go in the section already created in my script .............
|
![]() |
|
|