Crediting points for Shanes Bomb
Re:
21 years 5 months agoGood idea, this supports the team like: Look, we have the best CUV and Bomber pilot.Originally posted by MajorTom
What about this? We could put 3 new splitters in a separate block next to the "team - results" block.
They would be "Functional Stats" "Repairs" and "Bomb Hits".
That would be nice.(I'll do a quick pog example for making the dummyscore stats a bit later)
Ever thought on Scrollbar Windows?If we have a game with 12 players (6 on each team) there wouldn't be enough room to put a second row of splitters (with the functional stats) below the first row of splitters.
If not, have a look at that Buda5GUI function (explanations can be found in the Readme) or I'll update the GUI code in the next beta version:
Code:
hwindow Buda5GUI.AddScrollbarWindow( hwindow parent,
string xPos,
string yPos,
int width,
int height,
int height_content,
string csv_title,
string font,
string colour,
bool fancyBorder );
~Buda5 Designer & Scripter
buda5.firstones.com
~Buda5 Designer & Scripter
buda5.firstones.com
Please Log in or Create an account to join the conversation.
Re:
21 years 5 months agoThat is a good idea, but:Originally posted by Roi Danton
Ever thought on Scrollbar Windows?
The player normally won't have time to scroll through when the game cycles, and
he should be able to make a screen shot of the whole GUI at once for his "Trophy" collection
Here is the code examples
(code is no problem for me but creating and formating splitters is the absolute Horror for me)
Code:
/*
added to the MP scripts in the
function ServerOnUpdateScores()
right after:
//add a dummy bot entry which we use to record the total team kills counts
iMultiplay.AddBotEndGameInfo( "DUMMYSCORE_KILLS",
"",
Global.Int("ATeamKills"),
Global.Int("BTeamKills"),
0 );
*/
// get a list of all the cuv ships on the map (this map only has 80 km radius)
cuvs = List.FromSet ( iSim.SimsInRadius ( iSim.Cast (Global.Handle ( "g_arena_centre")), 80000, T_Passenger ) );
for (i=0; i<List.ItemCount( cuvs ); ++i)
{
cuv_ship = iSim.Cast( List.GetNth( cuvs, i ));
name = Object.StringProperty (cuv_ship, "name");
name = String.Join ("cuvstats", name);
// add a dummy bot entry for each cuv pilot
iMultiplay.AddBotEndGameInfo( name,
iFaction.Name( iSim.Faction(cuv_ship) ),
Object.IntProperty(cuv_ship, "total_repair_count" ),
0,
0 );
}
// get a list of all the bombers ships on the map
bombers = List.FromSet ( iSim.SimsInRadius ( iSim.Cast (Global.Handle ( "g_arena_centre")), 80000, T_Tug ) );
for (i=0; i<List.ItemCount( bombers ); ++i)
{
bomb_ship = iSim.Cast( List.GetNth( bombers, i ));
name = Object.StringProperty (bomb_ship, "name");
name = String.Join ("bmbstats", name);
// add a dummy bot entry for each bomber pilot
iMultiplay.AddBotEndGameInfo( name,
iFaction.Name( iSim.Faction(bomb_ship) ),
Object.IntProperty(bomb_ship, "total_bomb_hits" ),
0,
0 );
}
/*
This would be read in the function roMPutils.ScoreScreamTeam()
like this
player_list = iMultiplay.ClientPlayerList();
for ( i = 0; i < num_players; i = i + 1 )
{
name = Text.Field( iMultiplay.ClientEndGameInfoName(i), FT_Text );
// dummy entry to record totals in
if ( name == "DUMMYSCORE_POINTS" || name == "*DUMMYSCORE_POINTS*" )
{
total_alpha_points = iMultiplay.ClientEndGameInfoFrags(i);
total_beta_points = iMultiplay.ClientEndGameInfoFlags(i);
}else if ( name == "DUMMYSCORE_KILLS" || name == "*DUMMYSCORE_KILLS*" )
{
total_alpha_kills = iMultiplay.ClientEndGameInfoFrags(i);
total_beta_kills = iMultiplay.ClientEndGameInfoFlags(i);
}
else if ( name == "*dead*" || name == "dead" )
{
debug
{
Debug.PrintString ("dead bot recorder: ");
Debug.PrintString( name );
Debug.PrintString( "\n " );
}
name ="";
}
else
{
team = iMultiplay.ClientEndGameInfoTeam(i);
frags = iMultiplay.ClientEndGameInfoFrags(i);
flags = iMultiplay.ClientEndGameInfoFlags(i);
died = iMultiplay.ClientEndGameInfoDied(i);
player_sim = iSim.Cast( List.GetNth(player_list, i) );
debug
{
Debug.PrintString( "Score screen, player name is: " );
Debug.PrintString( name );
Debug.PrintString( "\n " );
}
{
here, you could do something like this
if (String.Left (name, 8)== "cuvstats")
{
name = String.TrimLeft( name, 8);
// put name in the new splitter for "Functional Stats"
// put frags in the new splitter "Repairs"
// put "--" in the new splitter "Bomb hits"
}
else if (String.Left (name, 8)== "bmbstats")
{
name = String.TrimLeft( name, 8);
// put name in the new splitter for "Functional Stats"
// put "--" in the new splitter "Repairs"
// put frags in the new splitter "Bomb hits"
}
else // put the name and scores in the splitters that are already there
*/
Iwar2 Multiplayer Fan Site
Please Log in or Create an account to join the conversation.
Re:
21 years 5 months ago
Oops! Testing is better than theory even when a script compiles with no warning
iMultiplay.IsGameEnded() is only returned to a client so I edited out the query in the pog example above, since that function is done on the server.
For now, we'll just have to live with the short delay caused by looking for the cuv and bomber ships whenever the player uses the ingame score screen.
Meanwhile, I'll see if I can find an appropriate query to see if/when a game is over on the server.
Iwar2 Multiplayer Fan Site
iMultiplay.IsGameEnded() is only returned to a client so I edited out the query in the pog example above, since that function is done on the server.
For now, we'll just have to live with the short delay caused by looking for the cuv and bomber ships whenever the player uses the ingame score screen.
Meanwhile, I'll see if I can find an appropriate query to see if/when a game is over on the server.
Iwar2 Multiplayer Fan Site
Please Log in or Create an account to join the conversation.
Re:
21 years 5 months ago
I've looked deeper in your GUI code and it's the smartest for this usage, so no change on the existing code is required (besides if it should be more coloured).
So I used your suggestion.
Problem:
With the current style the problem is that there is a limitation due to the limited screen space. Here max 5 players at all can use bombers and/or cuvs.
Solutions:
1) Scrollbars ... if you agree here I'll update this with the help of the Buda5GUI package
2) Decreasing the name_width, frags_width, ... so maybe we get two more Splitters on the right side of the normal player list.
Btw, rebel players will be listed first.
Btw, nice new function:
~Buda5 Designer & Scripter
buda5.firstones.com
So I used your suggestion.
Problem:
With the current style the problem is that there is a limitation due to the limited screen space. Here max 5 players at all can use bombers and/or cuvs.
Solutions:
1) Scrollbars ... if you agree here I'll update this with the help of the Buda5GUI package
2) Decreasing the name_width, frags_width, ... so maybe we get two more Splitters on the right side of the normal player list.
Btw, rebel players will be listed first.
Code:
list special_name_list, fragscuv_list, fragsbomb_list;
bool special_units = false;
if (String.Left (name, 8)== "cuvstats")
{
name = String.TrimLeft( name, 8);
special_units = true; //that the appropriate windows will be appearing
name_entry = CreateAndInitialiseListBoxEntryComponentWindow(
0,
name_width,
20,
grey_box,
bold_font,
name);
modify_window_colours( name_entry, team );
if (team == "ALPHA") { List.AddHead(special_name_list, name_entry); }
else{ List.AddTail(special_name_list, name_entry); }
frags_entry = CreateAndInitialiseListBoxEntryComponentWindow(
0,
frags_width,
20,
grey_box,
bold_font,
String.FromInt(frags) );
modify_window_colours( frags_entry, team );
if (team == "ALPHA") { List.AddHead(fragscuv_list, frags_entry); }
else{ List.AddTail(fragscuv_list, frags_entry); }
fragsbomb_entry = CreateAndInitialiseListBoxEntryComponentWindow(
0,
frags_width,
20,
grey_box,
bold_font,
"--" );
modify_window_colours( frags_entry, team );
if (team == "ALPHA") { List.AddHead(fragsbomb_list, frags_entry);
else{ List.AddTail(fragsbomb_list, frags_entry); }
}
else if (String.Left (name, 8)== "bmbstats")
{
name = String.TrimLeft( name, 8);
special_units = true; //that the appropriate windows will be appearing
name_entry = CreateAndInitialiseListBoxEntryComponentWindow(
0,
name_width,
20,
grey_box,
bold_font,
name);
modify_window_colours( name_entry, team );
if (team == "ALPHA") { List.AddHead(special_name_list, name_entry); }
else{ List.AddTail(special_name_list, name_entry); }
frags_entry = CreateAndInitialiseListBoxEntryComponentWindow(
0,
frags_width,
20,
grey_box,
bold_font,
"--" );
modify_window_colours( frags_entry, team );
if (team == "ALPHA") { List.AddHead(fragscuv_list, frags_entry); }
else{ List.AddTail(fragscuv_list, frags_entry); }
fragsbomb_entry = CreateAndInitialiseListBoxEntryComponentWindow(
0,
frags_width,
20,
grey_box,
bold_font,
String.FromInt(frags) );
modify_window_colours( frags_entry, team );
if (team == "ALPHA") { List.AddHead(fragsbomb_list, frags_entry);
else{ List.AddTail(fragsbomb_list, frags_entry); }
}
// later between the upper splitters (team) and the lower splitters (players)
iGUI.CreateWindowListInSplitter( //existing
grey_box,
totals_list,
current_x + name_width + 10,
80,
"" );
//CUV/Bomber Stats
if( special_units == true)
{
iGUI.CreateWindowListInSplitter(
grey_box,
special_name_list,
current_x + name_width + flags_width + 20 + 2 * gap_width,
80,
Text.Field("ro_mp_totals", FT_Text) );
iGUI.CreateWindowListInSplitter(
grey_box,
fragscuv_list,
current_x + 2 * name_width + flags_width + 30 + 2 * gap_width,
80,
Text.Field("????", FT_Text) ); //"Repair"
iGUI.CreateWindowListInSplitter(
grey_box,
fragsbomb_list,
current_x + 2 * name_width + flags_width + 40 + 2 * gap_width + frags_width,
80,
Text.Field("????", FT_Text) ); //"Bomb Hits"
}//CUV/Bomber Stats
iGUI.CreateWindowListInSplitter( //existing
grey_box,
name_list,
current_x,
stats_offset,
Text.Field( "mp_game_player", FT_Text ) );
Btw, nice new function:
MajorTom
This would be read in the function roMPutils.ScoreScreamTeam()

~Buda5 Designer & Scripter
buda5.firstones.com
~Buda5 Designer & Scripter
buda5.firstones.com
Please Log in or Create an account to join the conversation.
Re:
21 years 5 months ago
very cool work Roi [8D]
If you don't mind the work, you can definatly put in a scroll function in case there are more than 5 special units. The player probably won't have time to scroll anyhow before the game cycles, but at least if there are more than 5 it won't spill over into the splitters below.
If it is too much work, 5 slots for special units should be enough (with an average of 6 players per team, there probably won't be more than 2 special unit ships per team).
On the readout, part you'll have to change the query, where you have:
While testing I discovered that the name recieved by the client is:
"*cuvstatsMP_NAME_<Players name>"
So, you need to trim the String by 17 charachters to get the players actual name.
for example
if (String.Left (name, 4)== "*cuvs")
{
name = String.TrimLeft( name, 17);
btw, I think it would look better if we trim all the players names on the right by 5 charachters to get rid of the "__Alpha" or "__Beta"
(trim by 5, because I plan to change the name suffix to "_Rebs" and "_Imps" anyhow.) Ok?
The name suffixes are important to insure the faction allocation works correctly on the server. (but it doesn't matter if the string is "Alpha" or "Rebs" )
A secondary advantage: The name with suffix is shown in gamespy, so you can see who is playing on which team.
Iwar2 Multiplayer Fan Site
If you don't mind the work, you can definatly put in a scroll function in case there are more than 5 special units. The player probably won't have time to scroll anyhow before the game cycles, but at least if there are more than 5 it won't spill over into the splitters below.
If it is too much work, 5 slots for special units should be enough (with an average of 6 players per team, there probably won't be more than 2 special unit ships per team).
On the readout, part you'll have to change the query, where you have:
if (String.Left (name, <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="" title="Cool" /><!-- s8) -->== "cuvstats")
{
name = String.TrimLeft( name, <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="" title="Cool" /><!-- s8) -->;
While testing I discovered that the name recieved by the client is:
"*cuvstatsMP_NAME_<Players name>"
So, you need to trim the String by 17 charachters to get the players actual name.
for example
if (String.Left (name, 4)== "*cuvs")
{
name = String.TrimLeft( name, 17);
btw, I think it would look better if we trim all the players names on the right by 5 charachters to get rid of the "__Alpha" or "__Beta"
(trim by 5, because I plan to change the name suffix to "_Rebs" and "_Imps" anyhow.) Ok?
The name suffixes are important to insure the faction allocation works correctly on the server. (but it doesn't matter if the string is "Alpha" or "Rebs" )
A secondary advantage: The name with suffix is shown in gamespy, so you can see who is playing on which team.
ROFLBtw, nice new function:
Iwar2 Multiplayer Fan Site
Please Log in or Create an account to join the conversation.
Re:
21 years 5 months ago
@Strings Trimming: Okay, I see.
Unfortunately due to the different splitters it isn't possible to make a unique scrollbar for the list. So I just put a scrollbar "around" the splitters.
I haven't compiled and tested it, so it could look horrible (b/c the position and size settings could be a little bit wrong), but I think now you get what is possible.
Before testing and compiling you must have downloaded the Buda5GUI package and put the header and package files in the appropriate folders and so on ... well, you know this for yourself.
~Buda5 Designer & Scripter
buda5.firstones.com
Unfortunately due to the different splitters it isn't possible to make a unique scrollbar for the list. So I just put a scrollbar "around" the splitters.
I haven't compiled and tested it, so it could look horrible (b/c the position and size settings could be a little bit wrong), but I think now you get what is possible.
Before testing and compiling you must have downloaded the Buda5GUI package and put the header and package files in the appropriate folders and so on ... well, you know this for yourself.
Code:
hwindow scrollbar_window;
//CUV/Bomber Stats
if( special_units == true)
{
scrollbar_window = Buda5GUI.AddScrollbarWindow( grey_box,
current_x + name_width + flags_width + 20 + 2 * gap_width, //xPos
80-30, //yPos - additional scrollbar height (b/c the title of the scrollbar must be above it)
name_width + 2 * frags_width + 20, //width
84 + 46 + 30, //height (BoxEntryWindow height + rest height (circa) + additional scrollbar height
20 * num_players + 20, //content height, number of players + additional (safety ;) ) height
Text.Field("????", FT_Text) ), //title, for example "special performance"
"", //Font, defined below
"", //Colour, defined below
false ); //Fancy Border
Buda5GUI.SetFont( scrollbar_window, "ocrb_10pt" );
Buda5GUI.OneColour( scrollbar_window, "gold" );
iGUI.CreateWindowListInSplitter(
scrollbar_window,
special_name_list,
1,
5,
Text.Field("ro_mp_totals", FT_Text) );
iGUI.CreateWindowListInSplitter(
scrollbar_window,
fragscuv_list,
name_width + 10,
5,
Text.Field("????", FT_Text) ); //"Repair"
iGUI.CreateWindowListInSplitter(
scrollbar_window,
fragsbomb_list,
name_width + frags_width + 20,
5,
Text.Field("????", FT_Text) ); //"Bomb Hits"
}//CUV/Bomber Stats
~Buda5 Designer & Scripter
buda5.firstones.com
~Buda5 Designer & Scripter
buda5.firstones.com
Please Log in or Create an account to join the conversation.