Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   FMB, Mission & Campaign builder Discussions (http://forum.fulqrumpublishing.com/forumdisplay.php?f=203)
-   -   Hud Message (http://forum.fulqrumpublishing.com/showthread.php?t=38145)

Punch_145 01-19-2013 03:41 PM

Hud Message
 
Trying to get a hud message to appear when an aircraft is destroyed but cant find the code to get a players name or the class he destroyed to display.

Tried a number of different ways to this but no joy .

Code:

public override void OnAircraftKilled(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftKilled(missionNumber, shortName, aircraft);

        GamePlay.gpHUDLogCenter("?PlayerName? Destroyed + ?planeType?");

    }

}


Is there a way to get this to display?

Regards

Punch

Punch_145 01-21-2013 11:34 AM

Anybody point me in the right direction..................Still get an error at the end of the GamePlay.gpHUDLogCenter line ?
How do I end that line ?


Code:

using System;
using maddox.game;
using maddox.game.world;

public class Mission : maddox.game.AMission
{

    public override void OnAircraftKilled(int missionNumber, string shortName, AiAircraft aircraft)
    {
        base.OnAircraftKilled(missionNumber, shortName, aircraft);

        if (aircraft != null && damagedAircrafts.Exists(element => element == aircraft))
        {
            GamePlay.gpHUDLogCenter(null, "{0} Shot Down" + planeType +");
        }
    }
}


bolox 01-21-2013 12:31 PM

Not sure this is exactly what you are trying to achieve

Code:

public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> initiatorList)
    {
       

        if (actor is AiAircraft)
        {
            if (shortName.IndexOf("607Sqn", 0) > 0) MySquad++;// indicate playerSqn loss

            if (actor.Army() == 2)
            {
                cEnemy++;
                //GamePlay.gpHUDLogCenter(shortName);
                if (shortName.IndexOf("ErprGr210F", 0) > 0) hunt++;
            }

            else bomb++;

is a snippet from Redux campaign that shows something similar to what you want?- particularly the commented out HUDLog line

The 'plane type' is handled by referencing the Sqn shortName and incrementing 'counters- probably not elegant but is good enough for what was required in that campaign

Punch_145 01-21-2013 01:48 PM

Hi Bolox,
Was trying to get the kind of message you see in the server menu into the hud for a online dogfight.
Something like this:
http://i1187.photobucket.com/albums/...ps3f049b4c.jpg


All times are GMT. The time now is 12:06 AM.

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