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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2012, 04:50 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default Show userlabel after recon passthrough

I'm tying to show a custom label on the mini-map to blue players once a recon plane has gone through a pass-through trigger over the target. I'm having difficulty coming to grips with the various userlabel methods.The code below has errors. Baby steps please, explaining each method's use.

Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
    {
        base.OnTrigger(missionNumber, shortName, active);

        //RAF Dunkirk recon Do17
        if (shortName == "RAF_Dunkirk" && active)
        {   // Do17 recon'd RAF Dunkirk
            Point2d p = new Point2d();
            p.x = 221501.43;
            p.y = 252603.72;
            List<Player> BluePlayersList = new List<Player>();
            foreach (Player player in GamePlay.gpRemotePlayers()) if (player.Army() == 2) BluePlayersList.Add(player);
            Player[] BluePlayersArray = BluePlayersList.ToArray();
            double t = GamePlay.gpTimeofDay();
            GPUserLabel lbl = GamePlay.gpMakeUserLabel(p, BluePlayersArray, "RAF Dunkirk", t, GPUserIconType.Factory);
            GamePlay.gpDrawUserLabel(lbl);
        }
    }
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE

Last edited by salmo; 11-03-2012 at 05:07 AM.
Reply With Quote
  #2  
Old 11-03-2012, 05:22 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Your mistake:
Code:
GPUserLabel lbl = GamePlay.gpMakeUserLabel(p, BluePlayersArray, "RAF Dunkirk", t, GPUserIconType.Factory);
is the BluePlayerArray, the argument must be the player who created the lable (works in singl player) or Gameplay.gpPlayer() (for dedi server)

to show the lable only to one side use you must use:
Code:
GamePlay.gpDrawUserLabel(BluePlayersArray, lbl);
Reply With Quote
  #3  
Old 11-03-2012, 05:47 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Thankyou again Kodiak, I'm using this in the dedi server context but MakeUserLabel fails with invalid arguement(s) What's the purpose behind the method taking an arguement for the player who created the label? Surely there will be instances where the scripter wants to display a label at times when no actual player has 'created' the label?

Code:
double t = GamePlay.gpTimeofDay();
GPUserLabel lbl = GamePlay.gpMakeUserLabel(p, GamePlay.gpPlayer(), "RAF Dunkirk", t, GPUserIconType.Factory); // compile error
GamePlay.gpDrawUserLabel(BluePlayersArray, lbl);
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE

Last edited by salmo; 11-03-2012 at 06:17 AM.
Reply With Quote
  #4  
Old 11-03-2012, 06:20 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

GPUserIconType is an enum type the argument type is int so you must cast (int)
Code:
GPUserLabel lbl = GamePlay.gpMakeUserLabel(p, GamePlay.gpPlayer(), "RAF Dunkirk", t, (int)GPUserIconType.Factory);
Sorry have overseen it.

Last edited by FG28_Kodiak; 11-03-2012 at 06:24 AM.
Reply With Quote
  #5  
Old 11-03-2012, 07:20 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

That did it. Thankyou again for the assistance.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE
Reply With Quote
Reply


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 08:39 AM.


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