Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to set custom container/container inventory sizes on pylons #214

Open
jpw1991 opened this issue May 24, 2023 · 0 comments
Open

unable to set custom container/container inventory sizes on pylons #214

jpw1991 opened this issue May 24, 2023 · 0 comments
Labels
bug Something isn't working can't fix I am unable to fix the problem. help wanted Extra attention is needed

Comments

@jpw1991
Copy link
Owner

jpw1991 commented May 24, 2023

Describe the bug

Bug: Unable to set custom inventory sizes without causing error. Help welcomed to fix this (I have no idea right now).


Long-standing issue #100 was the result of trying to set custom inventory sizes for pylons. I was able to fix that issue with:

  1. Delete the Container script from the prefab
  2. Add it via code instead & set the name
  3. Do not attempt to resize the container/inventory -> instantly results in this error
            // originally the Container was set on the prefab in unity and set up properly, but it will cause the
            // problem here:  https://github.com/jpw1991/chebs-necromancy/issues/100
            // So we add it here like this instead.
            // Pros: No bug
            // Cons: Cannot set custom width/height
            _container = gameObject.AddComponent<Container>();
            _container.m_name = "$chebgonaz_neckrogathererpylon_name";
            // _container.m_width = ContainerWidth.Value;
            // _container.m_height = ContainerHeight.Value;

            var inv = _container.GetInventory();
            inv.m_name = Localization.instance.Localize(_container.m_name);
            // trying to set width causes error here: https://github.com/jpw1991/chebs-necromancy/issues/100
            // inv.m_width = ContainerWidth.Value;
            // inv.m_height = ContainerHeight.Value;
@jpw1991 jpw1991 added bug Something isn't working help wanted Extra attention is needed can't fix I am unable to fix the problem. labels May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working can't fix I am unable to fix the problem. help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant