miki151 / keeperrl

Source code of KeeperRL
GNU General Public License v2.0
871 stars 111 forks source link

furnitrure tribe inheeritance #1999

Open samuellsk opened 1 year ago

samuellsk commented 1 year ago

if furniture creates another furniture , its tribe is most likely not what of the original was. if you want to use such furniture , you need to unclaim and claim ground again.

for example:

"ABYSSUS_RANDOM_TRAINING" { name = "random training dummy" viewId = { "abyssus_training_1" } luxury = 0.5 tickType = Effect { RemoveFurniture "ABYSSUS_RANDOM_TRAINING" ChooseRandom { PlaceFurniture "ABYSSUS_TRAINING_1" PlaceFurniture "ABYSSUS_TRAINING_2" PlaceFurniture "ABYSSUS_TRAINING_3" PlaceFurniture "ABYSSUS_TRAINING_4" PlaceFurniture "ABYSSUS_TRAINING_5" } } }

"ABYSSUS_TRAINING_1" { name = "training dummy" viewId = { "abyssus_training_1" } canHideHere = true blockMovement = true usageType = BuiltinUsageId TRAIN maxTraining = { MELEE 99 } strength = 200 luxury = 0.5 destroyFX = { DESTROY_FURNITURE Rgb 120 120 120 255 } }

the furniture TRAINING_1 becomes unsusable by minions until unclaim / claim action has been done.

miki151 commented 1 year ago

Did ReplaceFurniture fix this?

samuellsk commented 1 year ago

Did ReplaceFurniture fix this?

YES, and you know, you were tagged in modding with my findings :)

Anyway, the "main" furniture needs to have all the fields as the one that is replacing it. In this example above, we are missing "usagetype" so that wont gonna solve this problem , unless the "random" furniture have this field also... This also works the other way, If the random (for whatever reason... ) have "blockmovement" and the replacement does not have that field, it will still have the blockmovement.

its a nonexistent issue,... i did provided all the fields with the "original" (random) and all works as expected.

I was more expecting that function is going to "clear" all the options and load the newones , not replacing values of the options (like view id , strength...etc)

Like i said , not an issue. function works as expected and is solving this problem.

THANK YOU.