Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 208 209 [210] 211 212 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1457937 times)

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3135 on: March 05, 2013, 12:31:34 am »

I know there is a script for make legendary, but how would I make a script to make a skill set to 0? I don't want my military to have civvie skills, because then they don't look as neat all lined up in a row. Also, would setting that skill to zero make them a peasant? Or would you have to make a separate script to change their profession type?
Removing all their skills does make them a peasant, yes.

Here's a snippet that should work to remove all skills from all dwarves in play.  As usual, it can be easily modified to work with a single dwarf.

Spoiler: remove_all_skills.lua (click to show/hide)

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3136 on: March 05, 2013, 12:33:18 am »

Haha, I like the way you give the user info on what the program's doing.

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3137 on: March 05, 2013, 11:24:46 am »

I know there is a script for make legendary, but how would I make a script to make a skill set to 0? I don't want my military to have civvie skills, because then they don't look as neat all lined up in a row. Also, would setting that skill to zero make them a peasant? Or would you have to make a separate script to change their profession type?
Removing all their skills does make them a peasant, yes.

Here's a snippet that should work to remove all skills from all dwarves in play.  As usual, it can be easily modified to work with a single dwarf.

Spoiler: remove_all_skills.lua (click to show/hide)
Will this change their profession to peasant automatically, or will that require another skill update. To show you what I mean: if you used make-legendary to change a peasant into a miner, would it call him a miner from the second you ran the script, or would it take another skill check to change his profession?
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3138 on: March 05, 2013, 11:30:46 am »

Just looking at the code, I strongly suspect he'd have to gain experience or do a job of some fashion for the game to recognize the change.
Logged
Through pain, I find wisdom.

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3139 on: March 05, 2013, 11:45:02 am »

Just looking at the code, I strongly suspect he'd have to gain experience or do a job of some fashion for the game to recognize the change.
Do you know a way to change that?
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3140 on: March 05, 2013, 11:52:22 am »

Offhand, no, but it's probably an enum field in the unit struct that can be set.  I'm at work right now so I can't really fiddle with it, but in theory it's doable without much modification to the script.
Logged
Through pain, I find wisdom.

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3141 on: March 05, 2013, 01:16:43 pm »

Just looking at the code, I strongly suspect he'd have to gain experience or do a job of some fashion for the game to recognize the change.
Yep, in the form I posted, this is accurate.  If the unit has a profession, and you remove all their skills, they will become a peasant (as an announcement) only after an additional update.  I've seen this happen (almost immediately) after a change of personality, preferences and attributes, but I don't know what the real/proper trigger is.
The profession update also seems to happen about one in-game month after a change in skill, typically.  To see this, you can embark with a starting seven that have skills allocated from the embark preparation screen, run remove_all_skills.lua, and then wait a month.  You'll see a/some/all dwarves be reduced to Peasants, as an announcement, after that in-game month has passed.

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3142 on: March 05, 2013, 01:28:39 pm »

I tried this script and it removed all skills from all adult dwarves. WTF?
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3143 on: March 05, 2013, 01:40:24 pm »

I tried this script and it removed all skills from all adult dwarves. WTF?

Almost like... it was meant to do that, eh?  And is the first line in the code acting as a description, which is displayed when you see the tool listed in 'ls' ...  :D

Ok, to have a single dwarf changed to a Peasant immediately (without an announcement), you can use:
--
EDIT:  I removed the code.  I'll put in a new post when I have time to test it properly.
--
Again, this doesn't address the problem of triggering the announcement and background check that would trigger it normally, but it does what you wanted, tahujdt.
« Last Edit: March 06, 2013, 11:41:59 am by vjek »
Logged

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3144 on: March 05, 2013, 01:42:17 pm »

How can I make it target an individual dwarf?
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?

vjek

  • Bay Watcher
  • If it didn't work, change the world so it does.
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3145 on: March 05, 2013, 01:46:55 pm »

How can I make it target an individual dwarf?
I don't have time to separate that out today, but I strongly encourage you to look at the script and try cutting it out yourself.  LUA is a well documented and syntactically pleasant language, compared to some.  You can look at my individual-dwarf-affecting scripts on the wiki as a guide.
If you or someone else hasn't done that sometime between now and later in the week, I should have time in a few days and will post it then.

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3146 on: March 05, 2013, 10:24:14 pm »

How would you do this for individual skills? It bugs me that any XP at all in a skill means that it stays on the dwarf's skill list forever.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Intrinsic

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3147 on: March 06, 2013, 04:44:24 am »

How can I make it target an individual dwarf?
I don't have time to separate that out today, but I strongly encourage you to look at the script and try cutting it out yourself.  LUA is a well documented and syntactically pleasant language, compared to some.  You can look at my individual-dwarf-affecting scripts on the wiki as a guide.
If you or someone else hasn't done that sometime between now and later in the week, I should have time in a few days and will post it then.

Code: [Select]
-- Remove all skills for the currently selected dwarf. Use v etc to select a unit in game
-- ---------------------------------------------------------------------------
function BreathOfArmok(v)
unit=dfhack.gui.getSelectedUnit()
if unit==nil then
print ("No unit available!  Aborting with extreme prejudice.")
return
end

local skills=unit.status.current_soul.skills
for index,skill in ipairs(skills) do
   skill:delete()
end
skills:resize(0)
unit.profession = df.profession["STANDARD"]
print ("The foul breath of Armok has engulfed "..unit.name.first_name)
end
-- ---------------------------------------------------------------------------

BreathOfArmok()

This should do it i guess? completely untested, and it'll try and wipe the skills for anything selected, even a dog so may blow up(crash your game) :D will prolly be cheesy if used on an FB...
« Last Edit: March 06, 2013, 05:23:00 pm by Intrinsic »
Logged
Start Duelyst with a bonus 100gold, use referral code: Buttfungus
Enter during signup or ingame under Settings.

Mr S

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3148 on: March 06, 2013, 09:07:02 am »

Fido McPetDog
Dabbling Barker
Dabbling Scent Marker
Dabbling Tracker
Novice Shoe Chewer
Dabbling Judge of Scent
Competent Carpet Stainer
Not Biter
Not Dodger
Not Kicker
Logged

tahujdt

  • Bay Watcher
  • The token conservative
    • View Profile
Re: DFHack 0.34.11 r2
« Reply #3149 on: March 06, 2013, 10:08:24 am »

This script will remove all skills, but also the ability to assign tasks to the dwarf in question.
Logged
DFBT the Dwarf: The only community podcast for Dwarf Fortress!
Tahu-R-TOA-1, Troubleshooter
Quote
I suggest that we add a clause permitting the keelhauling of anyone who suggests a plan involving "zombify the crew".
Quote from: MNII
Friend Computer, can you repair the known universe, please?
Pages: 1 ... 208 209 [210] 211 212 ... 373