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

Relic_data does not update after a transform #38409

Closed
foulman opened this issue Feb 27, 2020 · 15 comments · Fixed by cataclysmbnteam/Cataclysm-BN#38
Closed

Relic_data does not update after a transform #38409

foulman opened this issue Feb 27, 2020 · 15 comments · Fixed by cataclysmbnteam/Cataclysm-BN#38
Labels
Artifacts Otherworldly items with special effects stale Closed for lack of activity, but still valid.

Comments

@foulman
Copy link
Contributor

foulman commented Feb 27, 2020

Any item that uses relic_data to grant powers or attributes or even item based attack activations will not change after a transform is done on the item to change it.

Steps To Reproduce

  1. Download file, it contains a 3 item transform. One is a strength boost, one is a dex boost, one is no relic data at all.
  2. debug in one of the rings, note the item id you want is xring_.
  3. Once you get the ring, using the transform will not change the function of the ring, it will be stuck giving the bonuses of the item when you first picked it up. This also applies if you drop the item and pick it up again in a different state, drop it and save/reload, etc.
    This also seems to apply to items with on-hit powers, presumably the entire range of relic abilities are affected.

file: relic-ring-test.zip

As relic_data development continues, as it currently is, this will become a bigger problem, especially when recharging (ARTC_TIME and the like) comes into play.

Expected behavior

Items that undergo a transform should update themselves and behave as indicated in the JSON, as old artifact_data items do.

Screenshots

Versions and configuration

Additional context

I am aware of #38262 but am unsure if that would address this issue, or was intended to address this type of issue, therefore I'm posting this anyway so that at least a report has been made.

@KorGgenT KorGgenT added the Artifacts Otherworldly items with special effects label Feb 27, 2020
@KorGgenT
Copy link
Member

the linked pr was specifically to change how data's stored; i don't think it will affect this particular issue at all.

@KorGgenT
Copy link
Member

KorGgenT commented Mar 12, 2020

So I've been thinking about this for a while and I've still got a conundrum:

My current plan for artifacts (it's obviously not done yet, but it shouldn't be too far behind nested containers) is to make "artifacts" able to just be regular items. This would mean that for example, we could have an item with a transform. So, if the item transforms, we don't want it to lose the artifact-ness that the game randomly assigned, instead of was from the itype of the item, but I definitely see that there is some amount of benefit for modding for transforming artifacts.

@foulman
Copy link
Contributor Author

foulman commented Mar 12, 2020

So I've been thinking about this for a while and I've still got a conundrum:

My current plan for artifacts (it's obviously not done yet, but it shouldn't be too far behind nested containers) is to make "artifacts" able to just be regular items. This would mean that for example, we could have an item with a transform. So, if the item transforms, we don't want it to lose the artifact-ness that the game randomly assigned, instead of was from the itype of the item, but I definitely see that there is some amount of benefit for modding for transforming artifacts.

We didn't see any problem with that being inherited, I think that's expected in fact, much like a lot of other values are retained, but we also tried specifying 'empty' relic_data and alternative relic_data and neither of those worked. That would, I believe, be the best way for it to work, have it inherit (stay the same) after a transform unless it's specified that it should change or be stopped entirely.

Or as stated by another interested party which I agree with:

I'd say that there should ideally be both the ability to transform a relic's properties entirely AND to inherit it via transform, both would be useful. Perhaps make it so that it:

  1. Double-checks relic_data when it transforms.
  2. Interprets a deliberately empty but present relic_data block as "clear the relic data"
  3. Interprets a different block of relic data as "change properties to this relic setup instead"
  4. Interprets complete absence of a relic data block as "inherit last relic state defined"

That said, updating relic data after a transform, and assigning relic data to both states of the item if inheritance is desired, would be workable too. Transforming generated artifacts will have to explicitly be build in someway anyway, so having to tell it outright to use the same relic data for both states could be baked into that.

@KorGgenT
Copy link
Member

So interpreting the relic_data blocks in json as something implicit is right out. A flag could be added i suppose, that tells the item to overwrite the artifact data? It's really not my favorite idea. I'll have to think on the possibilities of comparing the enchantments with the enchantments from the itype and inherit that way

@foulman
Copy link
Contributor Author

foulman commented Mar 12, 2020

There's just a lot of functionality lost that currently exists with artifacts if there's no way to switch things on and off or between different "sets". That would be a loss to functionality in not only magiclysm but also to things aftershock would probably want available, so some sort of override flag would be good.

@KorGgenT
Copy link
Member

KorGgenT commented Mar 12, 2020

I'll have to think on the possibilities of comparing the enchantments with the enchantments from the itype and inherit that way

was this unclear? an override flag is one way to do it, yes, but i think there might be a more elegant solution by comparing the enchantment on the item to its itype when it transforms, and inherit the part that is not on the itype.

@foulman
Copy link
Contributor Author

foulman commented Mar 12, 2020

Yes, it was a little unclear as you dropped into cataclysm c++ speak for some unknown reason.
How elegant it ultimately is is entirely up to you, I was merely restating the need for it, I beg your forgiveness.

@KorGgenT
Copy link
Member

you dropped into cataclysm c++ speak for some unknown reason

To be more clear, an itype is the item as it is in json. It is always the same, and it is unchangeable. There's no extra data to it other than the stuff that's in json. An item, at least in terms of cdda, has lots of other data attached to it such as contents and the rot timer. I wanted to be especially clear so i used the term itype to mean that the enchantment attached to the json is there always, as opposed to an enchantment attached to an item from some other way (i.e. the procgen that i want to do eventually)

@foulman
Copy link
Contributor Author

foulman commented Mar 12, 2020

you dropped into cataclysm c++ speak for some unknown reason

To be more clear, an itype is the item as it is in json. It is always the same, and it is unchangeable. There's no extra data to it other than the stuff that's in json. An item, at least in terms of cdda, has lots of other data attached to it such as contents and the rot timer. I wanted to be especially clear so i used the term itype to mean that the enchantment attached to the json is there always, as opposed to an enchantment attached to an item from some other way (i.e. the procgen that i want to do eventually)

Yes that is much more clear, thank you.

chaosvolt added a commit to chaosvolt/nocts_cata_mod that referenced this issue Mar 20, 2020
* Overhauled the artifact properties of the biological weapons. Stat
boots now debuff strength and dexterity a bit in exchange for that +4
perception, has `AEP_SICK` and `AEP_SCHIZO` when carried, `AEP_EVIL` and
`AEP_PSYHIELD` when wielded.
* Ammo flags used have been shuffled around, making all of them mild
incendiary plasma weapons when used, with the advanced versions becoming
more fiery, using napalm/stream effects differently, etc. Also converted
the main damage to a pierce damage block, with a note to switch from
armor_multiplier to proper pierce once the PR for that is in (post-0.E).
* Every biological ranged weapon except the pistol also can grant the
bloodlust adrenaline surge effect when you get hit. Unlike with the
biological sword, the lack of transform means it won't be affected by
CleverRaven/Cataclysm-DDA#38409, so that's
good at least. Tested that crafting with the pistol correctly grants the
output the intended relic effect.
* Some obsolete things like aim speed and sight dispersion removed from
them, since weapon dispersion tends to be used mpore often in place of
sight dispersion.
* Some rebalancing of ranges and dispersion with other Cata++ weapons in
mind.
* Set the UPS usage of each to consistently be one-fifth of the primary
damage.
* Fixed my having forgot to update the damage for a couple of the
`FIRE_20` Omnitech guns.
@stale
Copy link

stale bot commented Apr 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Apr 11, 2020
@Kenan2000
Copy link
Contributor

Kinda hoped to see if anyone's found any likely cause in the code of this. In addition to the above concerns with the future use of this feature in Magiclysm, the impact it will have on conversion of artifacts, and in the OP's own projects, I recently noticed that Cataclysm++ actively makes use of transforming artifacts as well

@stale stale bot removed the stale Closed for lack of activity, but still valid. label Apr 13, 2020
@KorGgenT
Copy link
Member

i haven't picked the artifact project back up as i've been busy with nested containers.

@stale
Copy link

stale bot commented May 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label May 13, 2020
@Kenan2000
Copy link
Contributor

Kenan2000 commented May 13, 2020

I and other modders that have to face this issue would be really thankful if you pin this for the 0.F milestone so that it won't keep being marked as stale, can you do this, @KorGgenT ? This is a long-term issue that will need to be fixed once you get to work on the relic overhaul, so it likely shouldn't be flagged as stale before you've had the opportunity to work on that feature 😄

@stale stale bot removed the stale Closed for lack of activity, but still valid. label May 13, 2020
@kevingranade kevingranade added the stale Closed for lack of activity, but still valid. label May 14, 2020
@stale
Copy link

stale bot commented Jun 13, 2020

This issue has been automatically closed due to lack of activity. This does not mean that we do not value the issue. Feel free to request that it be re-opened if you are going to actively work on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Artifacts Otherworldly items with special effects stale Closed for lack of activity, but still valid.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants