Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Two Tokens Fighting Eachother  (Read 1100 times)

rico6822

  • Bay Watcher
  • Constantly fails to become elephant man.
    • View Profile
Two Tokens Fighting Eachother
« 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?
« Last Edit: June 29, 2021, 02:34:58 am by rico6822 »
Logged
Does anybody know how to become an elephant man in adventure mode? I literally did all advanced world settings possible to increase chances.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Two Tokens Fighting Eachother
« Reply #1 on: June 29, 2021, 03:18:06 am »

It goes from top to bottom. This is why there are [GO_TO_END], [GO_TO_START] and [GO_TO_TAG:tag] tokens.

rico6822

  • Bay Watcher
  • Constantly fails to become elephant man.
    • View Profile
Re: Two Tokens Fighting Eachother
« Reply #2 on: June 29, 2021, 03:52:51 am »

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?
« Last Edit: June 29, 2021, 03:55:36 am by rico6822 »
Logged
Does anybody know how to become an elephant man in adventure mode? I literally did all advanced world settings possible to increase chances.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Two Tokens Fighting Eachother
« Reply #3 on: June 29, 2021, 04:24:43 am »

No, it just puts all the following tokens at the very end of the current creature definition.

rico6822

  • Bay Watcher
  • Constantly fails to become elephant man.
    • View Profile
Re: Two Tokens Fighting Eachother
« Reply #4 on: July 01, 2021, 09:13:41 pm »

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.
« Last Edit: July 01, 2021, 09:16:54 pm by rico6822 »
Logged
Does anybody know how to become an elephant man in adventure mode? I literally did all advanced world settings possible to increase chances.

rico6822

  • Bay Watcher
  • Constantly fails to become elephant man.
    • View Profile
Re: Two Tokens Fighting Eachother
« Reply #5 on: July 01, 2021, 09:37:20 pm »

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].
Logged
Does anybody know how to become an elephant man in adventure mode? I literally did all advanced world settings possible to increase chances.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Two Tokens Fighting Eachother
« Reply #6 on: July 01, 2021, 10:36:47 pm »

If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:

Code: [Select]
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.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

rico6822

  • Bay Watcher
  • Constantly fails to become elephant man.
    • View Profile
Re: Two Tokens Fighting Eachother
« Reply #7 on: July 02, 2021, 01:00:31 am »

If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:

Code: [Select]
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?
Logged
Does anybody know how to become an elephant man in adventure mode? I literally did all advanced world settings possible to increase chances.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: Two Tokens Fighting Eachother
« Reply #8 on: July 03, 2021, 06:58:24 am »

If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:

Code: [Select]
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".
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

rico6822

  • Bay Watcher
  • Constantly fails to become elephant man.
    • View Profile
Re: Two Tokens Fighting Eachother
« Reply #9 on: July 03, 2021, 01:44:35 pm »

If you want to see what the "composite" raws for a creature variant actually look like, the following DFHack script should work:

Code: [Select]
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.
Logged
Does anybody know how to become an elephant man in adventure mode? I literally did all advanced world settings possible to increase chances.