#1
|
|||
|
|||
New Scripting Possibilities in Release candidate patch.
With the new patch its possible to get the Mission time.
Code:
double t = GamePlay.gpTimeofDay(); 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. |
#2
|
|||
|
|||
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 (Also, pressing enter creating a new label in map window fires my guns ) Hopefully someone nails the usage of the new label features.
__________________
|
#3
|
|||
|
|||
Didn't have luck with user labels too
|
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
I did a test with all icon stuff enabled, no success.
|
#6
|
|||
|
|||
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. |
#7
|
|||
|
|||
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. |
#8
|
|||
|
|||
Response from naryv about user label: http://www.sukhoi.ru/forum/showthrea...=1#post1906802
|
#9
|
|||
|
|||
Ive tried it on a Dedi-Server without result, so ...
|
#10
|
|||
|
|||
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. |
|
|