Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

WIP Score counter, Score superweapon

Open MortonPL opened this issue 4 years ago • 5 comments

Note: this is still quite WIP. Some extra things are unfinished, documentation incomplete and bugs may appear. PR ineligible for public testing.

Implements a customizable score counter, SuperWeapon granting via score and possibly customizable text alignment for strings.

Copy of documentation on SW granting:

  • It is now possible to award specific countries with single-use Super Weapons for reaching a defined milestone in game score.
    • ScoreSuperWeaponN.Type specifies the Super Weapon type that will be granted. This tag is mandatory.
    • ScoreSuperWeaponN.Score sets the amount of score players of this country have to earn to receive aforementioned Super Weapon. This tag defaults to 0, meaning that the Super Weapon will be instantly awarded.

In rulesmd.ini:

[SOMECOUNTRY]                                                  ; Country
ScoreSuperWeaponN.Type=SOMESWTYPE          ; SuperWeaponType
ScoreSuperWeaponN.Score=0                              ; integer
; where N = 0, 1, 2, ...

Copy of documentation on score counter:

  • This opt-in counter displayes the in-game score (value of killed units minus value of dead units) for the player.
  • The counter is displayed with the format of (Points)Label. The label is ★ U+2605 by default.
  • You can adjust counter position by Sidebar.ScoreCounter.Offset, negative means left/up, positive means right/down.
  • You can supply your own color through Sidebar.ScoreCounter.Color, in RGB values. The color is white (255,255,255) by default.
  • You can specify text alignment with Sidebar.ScoreCounter.Align, accepted values are Left, Right, Center/Centre. Defaults to Left.
  • You can also change the default position of the counter from the top of the sidebar to the command bar with Sidebar.ScoreCounter.DrawOnCommandBar. Defaults to no.

In uimd.ini:

[Sidebar]
ScoreCounter.Show=no						  ; boolean
ScoreCounter.Label=<none>					  ; CSF entry key

In rulesmd.ini:

[SOMESIDE]                                     ; Side
Sidebar.ScoreCounter.Offset=0,0                ; X,Y, pixels relative to default
Sidebar.ScoreCounter.Color=255,255,255		   ; R,G,B
Sidebar.ScoreCounter.Align=Left				   ; Left, Right, Center/Centre
Sidebar.ScoreCounter.DrawAtCommandBar=no		   ; boolean

Note: For the label to work, you need to download the improved font (v5 and higher) or draw your own icons.

MortonPL avatar Aug 23 '21 23:08 MortonPL

Nightly build for this pull request:

github-actions[bot] avatar Aug 25 '21 09:08 github-actions[bot]

ScoreCounter.Label= is borked, won't hide it and shows up as an "X" Sidebar.ScoreCounter.Offset=0,0 would be good to get this somewhere outside of the top bar, it's very clogged up as is

ayylmaoRotE avatar Aug 25 '21 11:08 ayylmaoRotE

  1. if a SW is granted by a building, then by points, if you remove the building the SW disappears and only becomes available via said building
  2. they do not respect SW.NegBuildings. as in points take precedence over prerequisites
  3. they also ignore SW.AuxBuildings and AuxBuilding

ayylmaoRotE avatar Aug 25 '21 12:08 ayylmaoRotE

Suggestion: What about new tags for using score points like consumable points each time is used a SW? By using 1 time a SW the needed points will get substracted to the total points count & the SW that doesn't have the needed consumable points should disappear from the sidebar until you reach again the needed points.

FS-21 avatar Aug 25 '21 14:08 FS-21

Right now the focus is on visuals and bugfixing, though I've noted requested feature list down below. Priority one is correct command bar drawing, as this seems to be the best option to convey information without clutter. Of course, having the counter on the sidebar will still remain possible.

Ideas to consider later:

  • Implement score cost (addition/substraction of score) for SWs as a parallel mechanic to score milestone (the current one),
  • Reactivate unused [TECHNO]->Points to be used for scoring purposes instead,
  • Respecting SW tags like AuxBuildings or NegBuildings,
  • Suggested things that I've already forgotten

MortonPL avatar Aug 25 '21 20:08 MortonPL