Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 323 324 [325] 326 327 ... 373

Author Topic: DFHack 0.34.11 r3  (Read 1453013 times)

expwnent

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4860 on: November 16, 2013, 08:40:30 pm »

Yeah, if you can make it work by applying syndromes, then you can do it with syndromeTrigger. See the above link I made for the documentation.
Logged

urmane

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4861 on: November 18, 2013, 10:39:16 am »

Hello, I have a little problem : I can't launch stonesense (under Linux)

I have the stonesense plugin, I can load it, I have df_linux/hack/plugin/stonesense.plug.so, but as soon as I tape either stonesense or ssense in the DFHack command line, it say me that "stonesense is not a recognized command."

Is there an other way to launch stonesense, or is it a bug ?

Try the instructions here: http://dwarffortresswiki.org/index.php/Masterwork:Linux

YMMV
Logged

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4862 on: November 18, 2013, 03:52:25 pm »

Would it be possible to create a script that puts equipment on certain creatures as they enter the map?  Like, say I want to make a rare breed of wildlife called the "Red Chinchilla of Justice" and use a script to make it so that whenever one enters the map, it gets equipped with a cape.  I know this is possible to simulate with bodyparts and itemcorpses, but that can lead to some weird behavior (i.e. armor being severed), so I was wondering if there was another way.  Could also allow for some interesting, less stupid ideas, like demons that wield unique weapons.

Rumrusher

  • Bay Watcher
  • current project : searching...
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4863 on: November 19, 2013, 09:05:08 pm »

Would it be possible to create a script that puts equipment on certain creatures as they enter the map?  Like, say I want to make a rare breed of wildlife called the "Red Chinchilla of Justice" and use a script to make it so that whenever one enters the map, it gets equipped with a cape.  I know this is possible to simulate with bodyparts and itemcorpses, but that can lead to some weird behavior (i.e. armor being severed), so I was wondering if there was another way.  Could also allow for some interesting, less stupid ideas, like demons that wield unique weapons.
make an entity race that adds stuff like that as a normal clothing option and have them be a Sieger maybe that would work?
Logged
I thought I would I had never hear my daughter's escapades from some boy...
DAMN YOU RUMRUSHER!!!!!!!!
"body swapping and YOU!"
Adventure in baby making!Adv Homes

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4864 on: November 20, 2013, 02:18:18 am »

Would it be possible to create a script that puts equipment on certain creatures as they enter the map?  Like, say I want to make a rare breed of wildlife called the "Red Chinchilla of Justice" and use a script to make it so that whenever one enters the map, it gets equipped with a cape.  I know this is possible to simulate with bodyparts and itemcorpses, but that can lead to some weird behavior (i.e. armor being severed), so I was wondering if there was another way.  Could also allow for some interesting, less stupid ideas, like demons that wield unique weapons.
make an entity race that adds stuff like that as a normal clothing option and have them be a Sieger maybe that would work?

I don't want all of the baggage or limitations that come with making them an entity.

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4865 on: November 20, 2013, 08:32:32 am »

It should be possible to write a plugin or script that ran frequently and spawned the item for a creature if they needed it.  The obvious problem here is that if it gets dropped they'll get a new one, and it might take a short while for the weapon to spawn the first time.  You probably wouldn't want to run this check every frame.

I can't remember the exact syntax for doing this in Lua, but there's an example floating around in the thread somewhere.  No idea about C++.
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 r3
« Reply #4866 on: November 20, 2013, 02:30:59 pm »

Testing so far on a goblin siege squad:

The leader has unit.relations.group_leader_id=-1, whereas the followers have unit.relations.group_leader_id=20633 (the leader's id).

If one of the followers is given unit.relations.group_leader_id=-1, he stands around clueless. However, if I then give other goblins unit.relations.group_leader_id=20640 (the NEW leader's id), the whole NEW squad starts to act like a squad and advance. When the goblins decided to retreat and end the siege, the NEW squad also retreated.

The original leader doesn't even have to die - I can choose another "leader" goblin in the group and split the squaddies 50/50 between the old and new group leader, forming two independant half-size squads. Each leader needs at least one follower to be able to move around.

unit.relations.unk_238 was different for the leader of a building destroyer creature squad - otherwise it appears to be zero. The number didn't match any unit ids.
This is excellent progress, Urist, please, keep it up.  To get this fixed would mean a great deal to my designs of automated goblin melting machines. :)  Vaporizing the leader always leads to frustration, currently.

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4867 on: November 20, 2013, 02:59:14 pm »

It should be possible to write a plugin or script that ran frequently and spawned the item for a creature if they needed it.  The obvious problem here is that if it gets dropped they'll get a new one, and it might take a short while for the weapon to spawn the first time.  You probably wouldn't want to run this check every frame.

I can't remember the exact syntax for doing this in Lua, but there's an example floating around in the thread somewhere.  No idea about C++.

Don't units have unique ID's?  Couldn't I, conceivably, record the ID and exclude them from future checks after the first equip?  I'm probably not competent enough with Lua to do it myself, though.  I'll have to dig through some internet tutorials and existing scripts to try to figure it out.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4868 on: November 20, 2013, 03:05:59 pm »

They do and you can; I tend to do it like this:

Code: [Select]
unitAlreadyChecked={}

function checkUnit(unit)
    ...stuff...
    unitAlreadyChecked[unit.id]=true
end

This is better used in an init.lua, given cross-world contamination.

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4869 on: November 20, 2013, 09:40:09 pm »

Testing so far on a goblin siege squad:

The leader has unit.relations.group_leader_id=-1, whereas the followers have unit.relations.group_leader_id=20633 (the leader's id).

If one of the followers is given unit.relations.group_leader_id=-1, he stands around clueless. However, if I then give other goblins unit.relations.group_leader_id=20640 (the NEW leader's id), the whole NEW squad starts to act like a squad and advance. When the goblins decided to retreat and end the siege, the NEW squad also retreated.

The original leader doesn't even have to die - I can choose another "leader" goblin in the group and split the squaddies 50/50 between the old and new group leader, forming two independant half-size squads. Each leader needs at least one follower to be able to move around.

unit.relations.unk_238 was different for the leader of a building destroyer creature squad - otherwise it appears to be zero. The number didn't match any unit ids.
This is excellent progress, Urist, please, keep it up.  To get this fixed would mean a great deal to my designs of automated goblin melting machines. :)  Vaporizing the leader always leads to frustration, currently.

I know how to write lua scripts, but we aren't close to a fix yet. Probable script logic:
Code: [Select]
For all units do:
   If I am a living invader and my squad leader is a valid unit but is dead/caged/? then:
      Elect a new squad leader using CriteriaFunction() from all living noncaged squad members including myself
      Alter the new squad leader to use the proper leader-ish settings and not be a follower anymore
      Update all squad members (those who share the same previous squad leader) with the new squad leader
   end
end

I am not sure if the logic is ok for all possible situations. I am not sure about criteria to use for leader elections, including how to elect or break ties if the ratings are equal. Obviously if the living invader is the only surviving member of the squad, he becomes the leader of his one-person squad. The script would ignore non-invader types since I don't want to reassign dwarven militia squads or anything silly like that.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4870 on: November 21, 2013, 11:54:51 am »

Is there any way to make a generic reaction use up water or magma, just like the steam engine does, just for any reaction?

Some kind of script I can call via autosyndrome maybe?

Something like this would be invaluable for making better "fill magma bottle" type reactions, as well as allowing you to make a workshop that uses magma and water to make obsidian.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Yacc

  • Bay Watcher
  • BLOOD FOR THE BLOODGOD SKULLS FOR THE SKULLTHRONE!
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4871 on: November 21, 2013, 02:05:30 pm »

i have a question about the workflow plugin: ive created some constraints and they are working, but my problem is that only one workshop is active at a time. when i manually unsuspend the repeated orders of the other ones, they are working as wanted for a moment, but get suspended by the workflow plugin very soon. its not cool having tons of material and idle dwarfs hanging around :'(. are there some settings i missed whic can solve that problem?
Logged
Blood For The Bloodgood! Skulls For The Skullthrone!

Ravendarksky

  • Bay Watcher
    • View Profile
    • DFMon.exe - Get rid of DF SPAM
Re: DFHack 0.34.11 r3
« Reply #4872 on: November 22, 2013, 04:57:38 am »

is it possible to use dfhack to make a dwarf give birth?
Logged

gzoker

  • Bay Watcher
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4873 on: November 22, 2013, 05:20:52 am »

Is it possible to write a script that would forbid a type of items every few ticks, if a type of building doesn't exist on the map?
Logged
Active Interactions: RAIDER_MADNESS

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: DFHack 0.34.11 r3
« Reply #4874 on: November 22, 2013, 08:29:28 am »

Don't units have unique ID's?  Couldn't I, conceivably, record the ID and exclude them from future checks after the first equip?  I'm probably not competent enough with Lua to do it myself, though.  I'll have to dig through some internet tutorials and existing scripts to try to figure it out.

Yeah, they do, but I don't know where you'd store them to exclude them from future checks.  I know DFHack supports saving things to your world save somehow, but it had limited storage if I recall and would probably run out quickly.

is it possible to use dfhack to make a dwarf give birth?

Are they already pregnant?  If so, open the Lua interpreter and run this after putting the cursor over the unit:

Code: [Select]
dfhack.gui.getSelectedUnit().relations.pregnancy_timer = 0

I think that's the code for it, but if not it should be pretty similar..  It's been a while.

Is it possible to write a script that would forbid a type of items every few ticks, if a type of building doesn't exist on the map?

I'm pretty certain it's possible, but don't know off the top of my head what the code looks like.  You'd have to iterate through the entire item list and whatever building list there is, so it's probably not something you'd want to do too frequently.
Logged
Through pain, I find wisdom.
Pages: 1 ... 323 324 [325] 326 327 ... 373