ddbrown30 / sfc

GNU General Public License v3.0
0 stars 3 forks source link

Not a number #2

Closed brunocalado closed 1 year ago

brunocalado commented 1 year ago

Hi. Great module.

I'm trying to make it work. What is wrong here?

image

ddbrown30 commented 1 year ago

I'm not sure. Do you know what you did to get it into that state? What happens if you change one of the coin values? What is your currency setting the SWADE system settings?

brunocalado commented 1 year ago

I'm not sure. Do you know what you did to get it into that state? What happens if you change one of the coin values? What is your currency setting the SWADE system settings?

Nothing. Do I need to do the iniatilize procedure before? I fear because it's my game world. The PCs have their coins in there.

brunocalado commented 1 year ago

I'm not sure. Do you know what you did to get it into that state? What happens if you change one of the coin values? What is your currency setting the SWADE system settings?

Is it possible to avoid this actor update? Can it work by just dragging coins to the actor? Run a script in a big game world is scary.

ddbrown30 commented 1 year ago

Nothing should have created a NaN state but yes, you should run the init before you start using it. That said, don't do it now or things might get more broken.

If you disable the module, is it still broken?

A few questions. Please answer all of them. It'll help me understand what might be going wrong.

ddbrown30 commented 1 year ago

Also, yes, the init step is optional but it will require you to manually calculate and set the coin counts. Just write down the currency amount before you start because as soon as you start entering coin values it will start updating the currency amount.

This might even fix your NaN issue (if you already know how much currency they had before) but I would suggest you wait until I fix the bug that caused the NaN as I can't guarantee it won't cause you other problems since I don't know why it happened in the first place.

brunocalado commented 1 year ago

What is the currency setting in the SWADE settings i.e. wealth die, currency, or none? none

Did you ever run the init step or did you just enable the module, open a sheet and it was already NaN? I never run the step.

Do all actors have a NaN or just one? Just one. Linked fvtt-Actor-bruk-utuh.json.txt

Have you tried disabling your other modules? Yes. image

If you can tell me everything you did before seeing that NaN, it will help a lot. I enabled your module. lol

brunocalado commented 1 year ago

Also, yes, the init step is optional but it will require you to manually calculate and set the coin counts. Just write down the currency amount before you start because as soon as you start entering coin values it will start updating the currency amount.

This might even fix your NaN issue (if you already know how much currency they had before) but I would suggest you wait until I fix the bug that caused the NaN as I can't guarantee it won't cause you other problems since I don't know why it happened in the first place.

I tried to change the coin quantity, but the actor sheet didn't update.

https://user-images.githubusercontent.com/4999783/232622853-178f0a75-7ddd-4586-9a24-b5ccd21b99c0.mp4

brunocalado commented 1 year ago

I made a backup and did the step. No success.

brunocalado commented 1 year ago

I made a backup and did the step. No success.

It added more coins. I already have coins on each sheet. But, even if I change this new coin, it don't update. image

ddbrown30 commented 1 year ago

Do all actors have a NaN or just one? Just one. Linked fvtt-Actor-bruk-utuh.json.txt

Ah, I can see the problem. That actor's currency is set to an empty string. I'm probably not handling that case. I'll just add something to treat that as 0.

ddbrown30 commented 1 year ago

Fixed. We now handle the case where currency is null or an empty string.