Talk:Random loot

From Pillars of Eternity Wiki
Jump to: navigation, search

Random loot seed generation[edit source]

As of latest game version with both expansions, chest seed is generated like this:

   private void SetSeed()
   {
       float single = base.transform.position.x;
       Vector3 vector3 = base.transform.position;
       Random.seed = (int)(single + vector3.z) * GameState.s_playerCharacter.name.GetHashCode() + WorldTime.Instance.CurrentDay;
   }

That means that 3 things are used to calculate random loot: chest position on map, player character name and current day of month. That also means that differently named characters will get same loot in same order, but with an offset of X days.

Chest loot is generated on first opening:

   public override bool Open(GameObject user, bool ignoreLock)
   {
       ...
       if (component && !this.HasInteracted)
       {
           component.PopulateInventory();
       }
       this.HasInteracted = true;
       ...


Is it applied like this in every game?[edit source]

Is this only applied when starting new game? Otherwise I cannot imagine how is it possible that in my game (currently with both expansions and updated to 3.03) I am getting the very same seed as many other players on forums.

PS: when creating talk pages and commenting in discussions, don't forget to sign yourself (4x ~ character)

FurloSK (talk) 08:22, 18 August 2016 (UTC)