|
Post by edenwrath on Sept 22, 2024 5:38:08 GMT
Hellow everyone, Thanks in advance for any help you will provide I'm making a template for a custom boardgame (or, more accurately, trying to make) and i'm relatively happy with all the standard stuff i've created so far... Of course, it requires some polishing but, all in all, won't complain... I have a question tho... is there a way to make a field unchangeable by the user ? what i mean is... My card type can be either "day" or "night" and one of the fields of my card is called "Terror level" If the card is of the "night" type, terror level vary, so the user must be able to change it If the card is of the "day" type tho, terror level is always 0. I found a way to set the value to 0 through a script, but i can change it afterward... would it be possible to make it so that, when the value is day, the field's value cannot be modified ? and, if not, is there a way to define a field as not modifiable, i can always create 2 fields and toggle the visibility when the type change
-- Edenwrath --
|
|
|
Post by cajun on Sept 22, 2024 7:15:35 GMT
Hellow everyone, Thanks in advance for any help you will provide I'm making a template for a custom boardgame (or, more accurately, trying to make) and i'm relatively happy with all the standard stuff i've created so far... Of course, it requires some polishing but, all in all, won't complain... I have a question tho... is there a way to make a field unchangeable by the user ? what i mean is... My card type can be either "day" or "night" and one of the fields of my card is called "Terror level" If the card is of the "night" type, terror level vary, so the user must be able to change it If the card is of the "day" type tho, terror level is always 0. I found a way to set the value to 0 through a script, but i can change it afterward... would it be possible to make it so that, when the value is day, the field's value cannot be modified ? and, if not, is there a way to define a field as not modifiable, i can always create 2 fields and toggle the visibility when the type change
-- Edenwrath --
there are two ways. you can do the two fields, with "editable: false" in the field definition, or you can do one field that does
script: if card.type == "day" then 0 else value this will run every time the user tries to edit the value, and if it's day, set it to 0, or otherwise leave it alone
|
|
|
Post by edenwrath on Sept 22, 2024 17:04:08 GMT
Maaaaan, was so simple i want to facepalm for not finding it on my own Thanks a ton, you're awesome -- Edenwrath --
|
|