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 09-30-2012, 06:23 PM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default New Scripting Possibilities in Release candidate patch.

With the new patch its possible to get the Mission time.

Code:
double t = GamePlay.gpTimeofDay();
it's a double so you must convert it into time Format.
Code:
    static string CreateTimeString(double num)
    {
        double hours = Math.Floor(num); 
        double minutes = (num - hours) * 60.0; 
        double seconds = (minutes - Math.Floor(minutes)) * 60.0;  
        int H = (int)Math.Floor(hours);
        int M = (int)Math.Floor(minutes);
        int S = (int)Math.Floor(seconds);   
        return H.ToString() + ":" + M.ToString() + ":" + S.ToString(); 
    }

Also we get the possibility to set lables, but i had no luck to get it to work. So maybe others can give me a hint how to use it.
Reply With Quote
  #2  
Old 09-30-2012, 07:39 PM
theOden theOden is offline
Approved Member
 
Join Date: May 2011
Location: Sweden
Posts: 221
Default

Regarding labels I've tried:

Code:
    public override void OnUserCreateUserLabel(GPUserLabel ul)
    {
        //Player ulPlayer = ul.Player;
        GamePlay.gpLogServer(null, "Marker: {0}", new object[] { ul.Text });
        GamePlay.gpDrawUserLabel(ul);
    }

    public override void OnPlaceEnter(Player player, AiActor actor, int placeIndex)
    {
		base.OnPlaceEnter(player, actor, placeIndex);
		
        //Point2d startPoint2d = new Point2d(actor.Pos().x, actor.Pos().y);
        //GPUserLabel userLabel = GamePlay.gpMakeUserLabel(startPoint2d, player, player.Name(), GamePlay.gpTimeofDay(), 0);
        //GamePlay.gpDrawUserLabel(player.Army(), userLabel);
        //GamePlay.gpLogServer(new Player[] { player }, " Hello {0} in {1}!", new object[] { bobDesignation((actor as AiAircraft).InternalTypeName()), userLabel.Text });
        //GamePlay.gpLogServer(null, " Hello {0} in {1}!", new object[] { bobDesignation((actor as AiAircraft).InternalTypeName()), userLabel.Text });
... etc
But no joy (I can use label properties but nothing visible on map).
(Also, pressing enter creating a new label in map window fires my guns )

Hopefully someone nails the usage of the new label features.
__________________
Reply With Quote
  #3  
Old 10-07-2012, 12:22 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Didn't have luck with user labels too
Reply With Quote
  #4  
Old 10-07-2012, 01:10 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

I tried scripting labels as well. No compiler errors, but no labels for ground object displayed in online mission. I wonder whether labels are only displayed with icons-on server settings?
__________________
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
  #5  
Old 10-07-2012, 06:54 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Quote:
Originally Posted by salmo View Post
I tried scripting labels as well. No compiler errors, but no labels for ground object displayed in online mission. I wonder whether labels are only displayed with icons-on server settings?
I did a test with all icon stuff enabled, no success.
Reply With Quote
  #6  
Old 10-07-2012, 07:22 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Me too,

i got the OnUserCreateUserLabel Event in single player but not in Multiplayer and Dedi. In all cases no Icon was shown. So it seems to be a Bug.
Reply With Quote
  #7  
Old 10-09-2012, 07:32 AM
Ataros Ataros is offline
Approved Member
 
Join Date: Jun 2010
Location: USSR
Posts: 2,439
Default

You may try test.zip sample from this post http://www.sukhoi.ru/forum/showthrea...=1#post1902755
or ask Naryv for details if it does not help.
Reply With Quote
  #8  
Old 10-11-2012, 10:47 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Response from naryv about user label: http://www.sukhoi.ru/forum/showthrea...=1#post1906802
Reply With Quote
  #9  
Old 10-11-2012, 10:51 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Ive tried it on a Dedi-Server without result, so ...
Reply With Quote
  #10  
Old 10-11-2012, 10:56 AM
41Sqn_Banks 41Sqn_Banks is offline
Approved Member
 
Join Date: Oct 2007
Posts: 644
Default

Quote:
Originally Posted by FG28_Kodiak View Post
Ive tried it on a Dedi-Server without result, so ...
Maybe it's working only with a player hosted server?

The example code of naryv doesn't use the gpMakeUserLabel method, it only shows a label created from a player to other players. I will try out naryv's example code, to see if the labels are displayed there. I only need a second player to test it ...

Last edited by 41Sqn_Banks; 10-11-2012 at 11:03 AM.
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:16 PM.


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