|
Post by edenwrath on Sept 24, 2024 2:37:07 GMT
Hellow everyone I hope i'm not bothering you guys too much with my question, but i need help again. There will be 2 different style folders attached to my game folder. in my game file, i have a choice field that can either by "Yes" or "No" i would like that field to have a different default value depending on the style used so that, when i create a new card, value is on "Yes" if i'm using style A and on "No" if i'm using style B. i tried to use add a script to the card field definition that says : if StyleCheck == "A" then "Yes" else "No"i get an error "can't convert from function to string" when i tried : if StyleCheck == "A" then fieldX := "Yes" else fieldX := "No"i get the same error with an additionnal warning "Can only assign to variable" -- "warning: last statement of a function should be an expression, that is, it should return a result in all cases" -- "expected closing '}' for this '{' instead of 'Yes' " -- "expected 'end of input' instead of 'else' " also tried if StyleCheck == "A" then card.fieldX.content_default := "Yes" else card.fieldX.content_default := "No"exactly the same result i'm sure i'm running in circles around the right solution but i can't seem to find it Would anyone be kind enough to point it to me ? Thanks a ton
-- Edenwrath --
|
|
GenevensiS
3/3 Beast
Posts: 171
Favorite Card: Baleful Strix
Favorite Set: Urza's Saga
Color Alignment: Blue, Black
|
Post by GenevensiS on Sept 24, 2024 8:22:52 GMT
I think the best way of doing this is as follows.
In the game's card_fields file, for that card field write:
card field: type: choice
name: fieldX choice: Yes choice: No
default: stylesheet; fieldX_default()
(Along with other properties it may need)
Then in the game's script file, define:
fieldX_default := { "Yes" }
Then in the init script of the template that needs this to be "No", overwrite:
fieldX_default := { "No" }
|
|
|
Post by edenwrath on Sept 24, 2024 15:38:58 GMT
It works ; thanks a ton ! more cookies for you -- Edenwrath --
|
|