Home

Updated a day ago

Home

GuaranteedCosmeticCrate Wiki

GuaranteedCosmeticCrate improves the vanilla cosmetic crate spawning system in REPO while keeping the game's original logic and multiplayer compatibility.

The mod does not replace REPO's crate system.

Instead, it:

  • monitors vanilla cosmetic crate spawning
  • detects when no crate spawned
  • forces a fallback cosmetic crate
  • optionally improves rarity chances
  • preserves multiplayer and vanilla behavior

How It Works

REPO normally spawns cosmetic crates through:

ValuableDirector.SetupHost()

During level setup, the game:

  1. Creates valuable spawn lists
  2. Creates volume lists
  3. Rolls cosmetic crate spawn chance
  4. Chooses crate rarity using vanilla curves
  5. Calls:
SpawnCosmeticWorldObject()

GuaranteedCosmeticCrate patches this process.


Spawn Detection

The mod checks:

cosmeticWorldObjectTargetAmount

This value tells how many cosmetic crates vanilla already spawned.

If vanilla spawned a crate

The mod does nothing.

Example:

Vanilla crate found
→ No forced spawn

Console:

[GuaranteedCrate] Vanilla already spawned crate(s): 1

If vanilla failed

The mod detects:

cosmeticWorldObjectTargetAmount == 0

and forces a cosmetic crate using REPO's own internal spawn system.

Console:

[GuaranteedCrate] No vanilla cosmetic crate detected.
[GuaranteedCrate] Forcing cosmetic crate spawn...

This guarantees at least one cosmetic crate.


Vanilla-Compatible Spawning

The mod uses REPO's original:

SpawnCosmeticWorldObject()

through reflection.

This means:

  • proper Photon sync
  • correct networking
  • vanilla volume logic
  • vanilla prefab spawning
  • bad luck system preserved

No custom Photon spawning.

No hardcoded prefabs.


Rarity System

REPO uses:

chanceCurve

inside:

CosmeticWorldObjectSetup

to decide crate rarity.

Each crate type has:

  • prefab
  • rarity
  • volume type
  • chance curve

The mod can boost rarity weights while still using vanilla logic.

Supported rarities:

Rarity Description
Common Standard cosmetic crate
Uncommon Better chance items
Rare Higher value cosmetics
UltraRare Best cosmetic crates

Guaranteed Crate Logic

Simplified logic:

Level starts
    ↓
Vanilla spawn runs
    ↓
Check cosmeticWorldObjectTargetAmount
    ↓
Crate exists?
    ↓
YES → stop
NO → force spawn

This avoids:

  • duplicate crates
  • desync
  • multiplayer problems

Configuration

Example:

[General]
GuaranteedCrate = true
SpawnChanceMultiplier = 1.5

[Rarity]
RareMultiplier = 1.5
UltraRareMultiplier = 2.0

[Debug]
VerboseLogs = true

Config Options

GuaranteedCrate

Guarantees at least one cosmetic crate.

Default:

true

SpawnChanceMultiplier

Boosts vanilla cosmetic spawn chance.

Higher value:

  • more frequent cosmetic crates

Default:

1.5

RareMultiplier

Boosts Rare rarity weight.

Default:

1.5

UltraRareMultiplier

Boosts UltraRare rarity weight.

Default:

2.0

VerboseLogs

Enables detailed console logging.

Default:

true

Console Logs

Useful logs:

Vanilla spawned:

[GuaranteedCrate] Vanilla already spawned crate(s): 1

Forced spawn:

[GuaranteedCrate] No vanilla cosmetic crate detected.
[GuaranteedCrate] Forcing cosmetic crate spawn...

Rarity roll:

[GuaranteedCrate] Selected rarity: UltraRare

Success:

[GuaranteedCrate] Cosmetic crate spawned successfully

Multiplayer

GuaranteedCosmeticCrate is designed for:

  • Host play
  • Multiplayer
  • Photon sync

Because it uses REPO's internal spawning system, clients receive the crate exactly like vanilla.


FAQ

Does this replace vanilla spawning?

No.

The mod only adds a fallback if vanilla fails.


Can it spawn multiple crates?

Vanilla still decides that.

The mod only guarantees a minimum of one.


Is multiplayer safe?

Yes.

The mod uses REPO's own spawn logic.


Does this break other mods?

Usually no.

Because it patches the vanilla flow instead of replacing it.


Pages