Custom Resource Types - #2375
Open
FS-21 wants to merge 33 commits into
Open
Conversation
Improved & splitted the code in auxiliar functions. Now the SW can modify the house points. Now a new General tag is added for default value when the tag isn't established in the techno. Added hook SuperClass_IsReady_BattlePoints for disabling the use of the SW if it doesn't have enough points (in reality is a rewrite of that IsReady() method adding this check) .
- Now friendly objects can have it's own default value. - Renamed the default value tag, - Realtime sidebar counter indicator. - New tag: Sidebar.BattlePoints.Offset - New tag: Sidebar.BattlePoints.Color - New tag: Sidebar.BattlePoints.Align - Now Chronoshere tele-kill will register the points (why not the nuke... :@ ).
…oints requisite. - Removed code used for optionally show this value. Now depends on the activation of the feature, since is weird to hide the current gathered points having a requisite in a SW that needs it.
- Fixed bugs - Added documentation
From BattlePointsGenerator to BattlePointsCollector
Now the +/- vaalues work like the tag Money.Amount
Applied feedback
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
Contributor
Author
|
I don't have enough time for online testing so I don't know how works in that environment. I only changed my ini codes for emulating the old Battle points from the old implementation. |
…urce-system # Conflicts: # src/Ext/Building/Body.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Is a rewrite of #1670 BattlePoints
Display.ResourceTypes.Orientationcontrols whether multiple resource counters stack vertically or horizontally on the HUD (Vertical/Horizontal).Display.ResourceTypes.Anchorsets the reference HUD anchor corner (TopRight,TopLeft,TopCenter,BottomRight,BottomLeft,BottomCenter,Sidebar).Display.ResourceTypes.BaseOffsetprovides an initial X,Y pixel offset for the resource display group.Display.ResourceTypes.Spacingspecifies the spacing in pixels between consecutive resource counters.Display.ResourceTypes.Aligntext alignment for HUD counters (Left,Center,Right; defaults toRightfor right anchors,Centerfor center anchors,Leftfor left anchors).Display.ResourceTypes.BackgroundPCXoptional PCX background image rendered behind the tactical HUD counters (takes precedence over SHP if both are defined).Display.ResourceTypes.Backgroundoptional SHP background image rendered behind the tactical HUD counters (without.shpextension; multi-frame SHPs animate continuously).Display.ResourceTypes.Background.Offsetoptional X,Y pixel offset for the background image (applies to both PCX and SHP).Display.ResourceTypes.Background.Paletteoptional palette for SHP background.Display.ResourceTypes.Background.Horizontal.ResourcesInsidewhen true andDisplay.ResourceTypes.Orientation=Horizontal, dynamically divides the background graphic's width proportionally among all currently visible resources so they stay nicely framed inside the background without overflowing (defaults tofalse).Display.Labelspecifies the CSF label key displayed alongside the counter.Display.Label.InvertPositionwhen set to true, places the label after the value (100 ★vs★ 100).Display.Label.UseSpacewhen set to false, omits the separating space between label and amount (100★or★100vs100 ★/★ 100). Defaults totrue.Display.Colorspecifies the text color (R,G,B) for the resource on the HUD and floating strings.Display.Conditionspecifies when the counter is visible (Always,GreaterThanZero,HasCollector,Never/Hidden/None).Display.Offsetoptional explicit X,Y screen coordinates overriding auto-stacking.InitialValuestarting resource amount granted to houses at match start.RequiresCollectorwhen true, the house resource only activates once a structure withResourceCollector.<Resource>=trueis built.Bounty.Enabledenables kill bounty rewards for this resource.Bounty.DefaultValuedefault bounty granted when destroying an enemy unit that lacks a specific bounty tag.Bounty.DefaultFriendlyValuebounty when destroying an allied unit.Bounty.CanUseStandardPointsfall back to the techno'sPoints=tag for bounty calculation.Bounty.MoneyConversiondivides the destroyed unit'sCost=by this value to determine the bounty reward when not explicitly defined on the techno (e.g. 100 calculates 700 / 100 = 7). Falls back toBounty.DefaultValueif result is 0.Crate.Amountamount granted when rolled from a money crate (if > 0, the resource enters the money crate raffle with equal probability alongside standard credits).Crate.Animoptional animation played at the crate location when this resource is awarded.Crate.Soundoptional sound effect played when this resource is awarded.Cost.<ResourceType>additional resource cost required to build the techno. Consumed progressively during production (pausing if funds are insufficient and fully refunded on cancellation), and consumed proportionally during structure repair and Service Depot unit repair.Bounty.<ResourceType>.Valuecustom bounty awarded to the killer when this enemy unit is destroyed.Bounty.<ResourceType>.FriendlyValuecustom friendly fire penalty applied if destroyed by an ally (e.g. -50; always evaluated as negative to prevent accidental rewards).Production.<ResourceType>,Production.<ResourceType>.Delay, andProduction.<ResourceType>.Startupconfigure periodic and initial resource generation. Works on all units, vehicles, infantry, aircraft, and buildings.Startupis optional (defaults to 0). Periodic production occurs everyDelayframes.Production.<ResourceType>.Display.Offsetoptional X,Y pixel offset for the floating string text relative to the object render center.Production.<ResourceType>.Display.Coloroptional R,G,B text color override for the floating string (falls back toDisplay.Colorfrom[<ResourceType>]).Production.<ResourceType>.Display.Housescontrols which players can see the floating string (All,Owner,Allies,Enemies,None, defaults toAll).ResourceCollector.<ResourceType>designates this unit or building as an active collector for this resource.ResourceType.<ResourceType>.Amountspecifies resource cost (positive) or grant (negative) upon firing.ResourceTypeandResourceValueconfigure Tiberium/Ore harvesting to yield custom resources. WhenResourceValue=is omitted,Value=is used for the custom resource and no money is granted (replaces money). WhenResourceValue=is defined,ResourceValueis used for the custom resource ANDValue=is used to grant standard money (dual income).Sidebar.ResourceTypes.Typeslist of resources to show on this side's sidebar (if omitted, all non-hidden resources are shown).[ResourceTypes]also supportsMoney,Power,Harvesters, andWeedspseudo-resources. Simply declare them in the list (e.g.0=Money,1=Power,2=Harvesters,3=Weeds) to customize their HUD display (labels, positioning, formatting, status colors, or moving them between the sidebar and the tactical screen).Moneyis declared, it automatically tracks player credits and replaces the default sidebar counter with the Resource HUD. It also supportsProduction.MoneyandResourceCollector.Money.Display.Formatcontrols the format of the displayed power value (NetAndTotal,Net,DrainAndTotal,Drain,Total; defaults toNetAndTotal).Display.ColorGreen,Display.ColorYellow,Display.ColorRed,Display.ColorGreyoptional R,G,B text colors for power states:ColorGreen: normal surplus power (defaults to0,255,0).ColorYellow: high drain / low power (defaults to255,255,0).ColorRed: power deficit / low power offline (defaults to255,0,0).ColorGrey: blackout active (defaults to128,128,128).Display.Coloris defined instead, it forces a single fixed static color regardless of power status.Harvestersis declared, it automatically tracks active and total harvesters and replaces the legacy sidebar harvester counter.Display.Formatcontrols the format of the displayed harvester counter (ActiveAndTotal,Active,Total; defaults toActiveAndTotal).Display.ColorGreen,Display.ColorYellow,Display.ColorRedoptional R,G,B text colors for harvester activity states:ColorGreen: all harvesters are actively harvesting or unloading (defaults to0,255,0).ColorYellow: some harvesters are active while at least one is idle (defaults to255,255,0).ColorRed: no harvesters are active / all idle (defaults to255,0,0).Display.Coloris defined instead, it forces a single fixed static color regardless of harvester activity.Weedsis declared, it automatically tracks the player's stored Veinhole monster Tiberium / Weeds (pPlayer->OwnedWeed.GetTotalAmount()) and replaces the legacy sidebar weeds counter.In
rulesmd.ini:*** Untested ***
Mp actions:
620-622Modify Custom Resource620: Sets the resource amount to a specific value.621: Adds the specified amount to the current resource amount.622: Subtracts the specified amount from the current resource amount.HouseIndexspecifies the target house (-1or omitted uses the trigger owner / current player).In
mycampaign.map:Map events:
610-611House Has Custom Resource Greater/Less Than610: Springs when the house owns strictly greater than the specified amount of the resource.611: Springs when the house owns strictly less than the specified amount of the resource.In
mycampaign.map: