[Version: 0.9.008-PUBLIC#2194] Tried accessing my storage, crashed

Meteor07

Well-Known Member
Feb 5, 2017
137
25
As title said above, went to check my ships(Sidewinder) storage, and the game crashed

Does so consistently

Since I have that pistol stored, I'm gonna try and see if removing it does anything.





Code:
 Version: 0.9.008-PUBLIC#2194 Message: PyriteIndustriesSuperchargedLaserPistol requires it's canMergeWith call to be overridden if it has dynamic properties. Stack:
TiTSException: PyriteIndustriesSuperchargedLaserPistol requires it's canMergeWith call to be overridden if it has dynamic properties.
    at r (https://www.fenoxo.com/play/TiTS/release/main.71d1079d.js:1:9574522)
    at o.value (https://www.fenoxo.com/play/TiTS/release/main.71d1079d.js:1:5610651)
    at https://www.fenoxo.com/play/TiTS/release/main.71d1079d.js:1:12321360
    at Array.filter ()
    at https://www.fenoxo.com/play/TiTS/release/main.71d1079d.js:1:12321268
    at Array.forEach ()
    at o.value (https://www.fenoxo.com/play/TiTS/release/main.71d1079d.js:1:12321118)
    at o.value (https://www.fenoxo.com/play/TiTS/release/main.71d1079d.js:1:12320317)
    at hu (https://www.fenoxo.com/play/TiTS/release/vendors.de74e163.js:1:464276)
    at Ts (https://www.fenoxo.com/play/TiTS/release/vendors.de74e163.js:1:481137)
 

Meteor07

Well-Known Member
Feb 5, 2017
137
25
Removing the pistol from my ship storage with save editor online worked.
 

Gedan

BUTTS BUTTS BUTTS
Staff member
Aug 26, 2015
8,008,893
8,008,326
No code I can find in the game would nominally set hasDynamicProperties on this item, so I'd have to guess either it was hand-modified at some point, or some ages old AS3 code did it that was long removed even before the JS port took over.
 

Meteor07

Well-Known Member
Feb 5, 2017
137
25
Huh. That does seem like a possibility, but I also wouldn't know, as I don't really dive deep into item code or modify properties of weapons.

One thing that I did notice in Save Editor Online was that the code for the weapon was unusually long, with seemingly multiple paragraphs for stats, but I'm also unsure if that was the case, so I'll look through it again, and see if I can find it again.

I'll also post the full thing here once I've found it.
 

Meteor07

Well-Known Member
Feb 5, 2017
137
25
Alright that didn't take long at all, this is the piece that I found in my save, thought it looks to be that there were 2 of the guns in my ships storage, for some reason.




Code:
          {
            "classInstance": "PyriteIndustriesSuperchargedLaserPistol",
            "neverSerialize": false,
            "version": 1,
            "hasDynamicProperties": true,
            "stackSize": 1,
            "quantity": 1,
            "hasUniqueName": true,
            "shortName": "SCL Pistol",
            "longName": "scoped pistol",
            "description_internal": "a scoped pistol",
            "tooltip": "This compact laser pistol is equipped with a rather impressive scope and energy cell of your own manufacture. It is quite accurate but relatively low-powered.",
            "attackVerb": "shoot",
            "attackNoun": "shot",
            "type": 4,
            "basePrice": 120,
            "level": 9,
            "rarity": 2,
            "customImage": "",
            "customIcon": "",
            "itemFlags": [
              37
            ],
            "attack": 3,
            "baseDamage": {
              "classInstance": "TypeCollection",
              "values": [
                0,
                0,
                5,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              "flags": [
                {
                  "classInstance": "DamageFlag",
                  "thisFlag": 6,
                  "triggers": []
                },
                {
                  "classInstance": "DamageFlag",
                  "thisFlag": 13,
                  "triggers": []
                }
              ]
            },
            "defense": 0,
            "shieldDefense": 0,
            "shields": 0,
            "sexiness": 0,
            "resolve": 0,
            "critBonus": 1,
            "evasion": 0,
            "fortification": 0,
            "hardLightEquipped": false,
            "resistances": {
              "classInstance": "TypeCollection",
              "values": [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              "flags": []
            },
            "lustGain": 0,
            "lustMin": 0,
            "isUsable": true,
            "combatUsable": false,
            "targetsSelf": true,
            "requiresTarget": false,
            "dynamicProperties": null
          },
          {
            "classInstance": "PyriteIndustriesSuperchargedLaserPistol",
            "neverSerialize": false,
            "version": 1,
            "hasDynamicProperties": true,
            "stackSize": 1,
            "quantity": 1,
            "hasUniqueName": true,
            "shortName": "SCL Pistol",
            "longName": "scoped pistol",
            "description_internal": "a scoped pistol",
            "tooltip": "This compact laser pistol is equipped with a rather impressive scope and energy cell of your own manufacture. It is quite accurate but relatively low-powered.",
            "attackVerb": "shoot",
            "attackNoun": "shot",
            "type": 4,
            "basePrice": 120,
            "level": 9,
            "rarity": 2,
            "customImage": "",
            "customIcon": "",
            "itemFlags": [
              37
            ],
            "attack": 3,
            "baseDamage": {
              "classInstance": "TypeCollection",
              "values": [
                0,
                0,
                5,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              "flags": [
                {
                  "classInstance": "DamageFlag",
                  "thisFlag": 6,
                  "triggers": []
                },
                {
                  "classInstance": "DamageFlag",
                  "thisFlag": 13,
                  "triggers": []
                }
              ]
            },
            "defense": 0,
            "shieldDefense": 0,
            "shields": 0,
            "sexiness": 0,
            "resolve": 0,
            "critBonus": 1,
            "evasion": 0,
            "fortification": 0,
            "hardLightEquipped": false,
            "resistances": {
              "classInstance": "TypeCollection",
              "values": [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ],
              "flags": []
            },
            "lustGain": 0,
            "lustMin": 0,
            "isUsable": true,
            "combatUsable": false,
            "targetsSelf": true,
            "requiresTarget": false,
            "dynamicProperties": null
          }
 

Gedan

BUTTS BUTTS BUTTS
Staff member
Aug 26, 2015
8,008,893
8,008,326
Yeah; hasDynamicProperties (in AS3 this was called hasRandomProperties as that's where the original idea came from) is a tool to reduce save size quite a lot - it saves off a coule of kb per character in the save data at least, and it also saves us writing a lot of property updaters when we tweak item stats.

Most of the time items are very static, so there's no point in us saving all of the properties for them and we can just rely on the code to recreate everything when loading the save. Sometimes we create temporary items for enemies to use that are based off of an existing one with tweaked stats, and we need something to indicate to the serialization system that it does actually need to copy all of the properties and not just the minimal set to recreate the inventory (ie type and quantity).

It was used in a handful of other places to "save" creating dedicated items; Aliss' hardlight underwear is an example of this.

I wrote some code that required a deeper understanding of this happening for the inventory system to handle things better, that's what canMergeWith exists for; we've gotta write an implementation for it on a case-by-case basis to figure out if two of the same item actually are the same when they can have different properties. I made this a hard error if the implementation doesn't exist for a given item in a scenario where one would be needed (ie hasDynamicProperties is true) and it's helped track down some subtle, multi-layered bugs. Zaalt was incidentally dropping his melee weapon through a confluence of systems interacting in an unintended way for example.

I can't find any instances where something similar could be happening to this weapon, but it took somebody making a near throwaway comment for me to figure out the Zaalt thing so it's entirely possible that I'm overlooking where this is coming from. My best guess is somebody wrote a save editor to just flip the flag if you edit any of the stats on the weapon, so that it will be persisted in the game save as expected or something along those lines.