Skip to content

Crate powerups

Formats

Changed in 0.3.0

Sets each crate result's share of the random crate draw, the animation it plays, and the number its effect uses.

Format
Kind
Record
File
RULES.INI, LANGRULE.INI, FIRESTRM.INI, LANGFS.INI, MPLAYER.INI, MPLAYERFS.INI, map file
Section
[Powerups]
Record form
<crate result>=<shares>,<AnimType ID>,<data>

Fields

#FieldAccepted valueRequired
1SharesInteger weight in the crate drawYes
2AnimationAnimType ID played where the crate was collected`<none>` for no animationNo
3DataNumber the result's effect usesNo

The keys of [Powerups] are the result names on the crate result page. The game reads only those names, so any other key, including a misspelled result name, has no effect. The section cannot add a new crate result. Crates describes what each result does with its number.

rules.ini
[Powerups]
Money=55,MONEY,2000 ; MONEY is an AnimType registered in rules.ini
Napalm=25,<none>,600
Reveal=8,REVEAL

Each rules file that has a [Powerups] section applies it in the order the rules files are read. A map’s section is applied after all of them, so a map can reweight the draw for games on that map.

Each time a scenario loads, the crate settings first return to the values they had before the first scenario, and the [Powerups] sections are then applied again. A value a map sets therefore applies only to games on that map.

Each field an entry writes replaces that result’s current value. Fields the entry leaves off keep their current values, so Reveal=8,REVEAL above keeps the number Reveal already had.

The animation field takes an AnimType ID. <none>, none, and an ID that matches no registered AnimType all give no animation. The AnimType must be registered by the same rules file or an earlier one; an ID that only a later file registers gives no animation.

The data field is a decimal number. Written with a percent sign, it is divided by 100, so 50% gives 0.5.

A [Powerups] section with at least one entry resets every crate result it does not list to a share of 0 with no animation. Only the number of an omitted result keeps its current value.

List every result you want to keep in each [Powerups] section you write. For example, a map section with two entries takes the other seventeen results out of the draw in that map’s games.

Shares are relative weights and need not add up to 100. Outside a campaign, each collected crate draws one result, and a result’s chance of being drawn is its share divided by the total of all shares. The drawn result can then be replaced, as Crates describes.

A share of 0 keeps a result out of the random draw, but a campaign crate or a replacement after the draw can still give it. Campaign crates ignore the shares: each gives the result that the rules name for its crate overlay, as Crates lists.

Source files

Linked at revision cfa7f5bbbc2e.

History

  1. Changed0.3.0In development

    Reset rule settings a map changed before the next game