Bay 12 Games Forum
Dwarf Fortress => DF Modding => Topic started by: rico6822 on June 29, 2021, 02:33:19 am
-
I'm planning to add 2 tokens about CLUSTER_NUMBER into a single creature variation. I'm using this for my randomizer mod, where CV_REMOVE_TAG:CLUSTER:NUMBER is above CV_ADD_TAG:CLUSTER:NUMBER:1:5.
Would that generate error or remove already present CLUSTER_NUMBER and replace it with random amount of spawned creatures from 1 to 5? Does Dwarf Fortress apply all tags at once or goes from above to below, making tags below override same but with different values tags as above?
-
It goes from top to bottom. This is why there are [GO_TO_END], [GO_TO_START] and [GO_TO_TAG:tag] tokens.
-
It goes from top to bottom. This is why there are [GO_TO_END], [GO_TO_START] and [GO_TO_TAG:tag] tokens.
Ok. So [GO_TO_END] makes it so it's read from bottom to top at some point?
-
No, it just puts all the following tokens at the very end of the current creature definition.
-
No, it just puts all the following tokens at the very end of the current creature definition.
Holy crap, you helped me a lot. You are going to be in credits of my randomizer. Now I know why everyone spawns so rarely.
I will slightly have to do everything over again.
-
No, it just puts all the following tokens at the very end of the current creature definition.
Nevermind, it did not broke anything but simply made my coding look less professional and just amateurish. You saved me from embarrasment.
I used to insert at the very end [GO_TO_END], than a creature variation and after a creature variation [GO_TO_START].
-
If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:
lua "for _,c in pairs(df.global.world.raws.creatures.all) do if (c.creature_id=='CREATURE_ID_GOES_HERE') then for _,r in pairs(c.raws) do print(r.value) end end end"
Just replace CREATURE_ID_GOES_HERE with your desired creature ID, then copy/paste the entire line into the DFHack console and press Enter.
Unfortunately, the output won't have any indentation, so it might be a bit difficult to read.
-
If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:
lua "for _,c in pairs(df.global.world.raws.creatures.all) do if (c.creature_id=='CREATURE_ID_GOES_HERE') then for _,r in pairs(c.raws) do print(r.value) end end end"
Just replace CREATURE_ID_GOES_HERE with your desired creature ID, then copy/paste the entire line into the DFHack console and press Enter.
Unfortunately, the output won't have any indentation, so it might be a bit difficult to read.
Holy crap! Thank you but wouldn't it mean that every time a new world is created the player would have to apply randomization to all generated creatures?
-
If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:
lua "for _,c in pairs(df.global.world.raws.creatures.all) do if (c.creature_id=='CREATURE_ID_GOES_HERE') then for _,r in pairs(c.raws) do print(r.value) end end end"
Just replace CREATURE_ID_GOES_HERE with your desired creature ID, then copy/paste the entire line into the DFHack console and press Enter.
Unfortunately, the output won't have any indentation, so it might be a bit difficult to read.
Holy crap! Thank you but wouldn't it mean that every time a new world is created the player would have to apply randomization to all generated creatures?
Er, I'm not sure I follow - I was just providing you with a means of visualizing the actual effect of "CV_ADD_TAG:CLUSTER:NUMBER:1:5".
-
If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:
lua "for _,c in pairs(df.global.world.raws.creatures.all) do if (c.creature_id=='CREATURE_ID_GOES_HERE') then for _,r in pairs(c.raws) do print(r.value) end end end"
Just replace CREATURE_ID_GOES_HERE with your desired creature ID, then copy/paste the entire line into the DFHack console and press Enter.
Unfortunately, the output won't have any indentation, so it might be a bit difficult to read.
Holy crap! Thank you but wouldn't it mean that every time a new world is created the player would have to apply randomization to all generated creatures?
Er, I'm not sure I follow - I was just providing you with a means of visualizing the actual effect of "CV_ADD_TAG:CLUSTER:NUMBER:1:5".
Ok.