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

Crash when assigning FArrays #62

Closed
apple1417 opened this issue Sep 17, 2019 · 1 comment
Closed

Crash when assigning FArrays #62

apple1417 opened this issue Sep 17, 2019 · 1 comment

Comments

@apple1417
Copy link
Contributor

Trying to assign any FArray object into an array field crashes the game. This means rather unintuitively, the following example will cause a crash:

obj1 = bl2sdk.FindObject("MissionDefinition", "GD_Anemone_Side_VaughnPart2.M_Anemone_VaughnPart2")
obj2 = bl2sdk.FindObject("WeaponTypeDefinition", "GD_Weap_Pistol.A_Weapons.WeaponType_Jakobs_Pistol")
obj3 = bl2sdk.FindObject("SkillDefinition", "GD_Assassin_Skills.Bloodshed.Execute")
obj4 = bl2sdk.FindObject("ItemPoolDefinition", "GD_CustomItemPools_Lilac.Psycho.BlueBold")

# Each line here causes a crash
obj1.Dependencies = obj1.Dependencies
obj2.WeaponIdleAnimations = obj2.WeaponIdleAnimations
obj3.SkillConstraints = obj3.SkillConstraints
obj4.BalancedItems = obj4.BalancedItems

If you convert the FArray into a list beforehand it will correctly be set, and the game won't crash. Not all fields support being assigned from a list however.

obj1 = bl2sdk.FindObject("MissionDefinition", "GD_Anemone_Side_VaughnPart2.M_Anemone_VaughnPart2")
obj1.Dependencies = list(obj1.Dependencies)
@apple1417
Copy link
Contributor Author

Duplicate of #28

@apple1417 apple1417 marked this as a duplicate of #28 Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant