Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 4 5 [6] 7 8 ... 61

Author Topic: [SUGGESTIONS] for DFhack plugins  (Read 137335 times)

peregarrett

  • Bay Watcher
  • Гномовержец Enjoyed throwing someone recently
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #75 on: February 03, 2013, 12:46:21 am »

A plugin to export the description text of item/engraving/creature you're watching, is it posible?
Logged
Did you know that the Russian word for "sock" is "no sock"?
I just saw a guy with two broken legs push a minecart with a corpse in it. Yeah.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #76 on: February 03, 2013, 02:50:44 pm »

Also allowed to have different type:
  • Caravan
  • Migrants
  • Diplomat
  • CivAttack
  • FeatureAttack - unused, does nothing
  • Megabeast
  • WildlifeCurious
  • WildlifeMischievous
  • WildlifeFlier
  • NightCreature
Might need to set up entity for those entries that need it (civ attack/caravan/diplomat etc...) or other fields that are unknown.

Aha! Fixed that issue. Here's the script (preferably "force.lua" or "forceevent.lua":

Code: [Select]
-- Forces an event.
--Function codes all based on Quietust's code.


local EventType = ...


if EventType == "caravan" or EventType == "diplomat" or EventType == "siege" or EventType == "migrants" then
if dfhack.gui.getSelectedUnit().civ_id==nil then
qerror('Caravan, diplomat, migrants and siege require a civ unit to be highlighted.')
end
end

--code may be kind of bad below :V Putnam ain't experienced in lua...
if EventType ~= "caravan" and EventType ~= "migrants" and EventType ~= "diplomat" and EventType ~= "megabeast" and EventType ~= "curiousbeast" and EventType ~= "mischievousbeast" and EventType ~= "mischeviousbeast" and EventType ~= "flier" and EventType ~= "siege" and EventType ~= "nightcreature" then
qerror('Invalid argument. Valid arguments are caravan, migrants, diplomat, megabeast, curiousbeast, mischievousbeast, flier, siege and nightcreature.')
end

function force_megabeast()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Megabeast, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end

function force_migrants()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Migrants, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end

function force_caravan()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Caravan, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end

function force_diplomat()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.Diplomat, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end

function force_curious()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeCurious, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end

function force_mischievous()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeMichievous, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end

function force_flier()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.WildlifeFlier, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end

function force_siege()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.CivAttack, season = df.global.cur_season, season_ticks = df.global.cur_season_tick, entity = df.historical_entity.find(dfhack.gui.getSelectedUnit().civ_id) } )
end

function force_nightcreature()
df.global.timed_events:insert('#', { new = df.timed_event, type = df.timed_event_type.NightCreature, season = df.global.cur_season, season_ticks = df.global.cur_season_tick } )
end

--this code may be bad too :V

if EventType=="caravan" then force_caravan()
elseif EventType=="migrants" then force_migrants()
elseif EventType=="diplomat" then force_diplomat()
elseif EventType=="megabeast" then force_megabeast()
elseif EventType=="curiousbeast" then force_curious()
elseif EventType=="mischievousbeast" or EventType=="mischeviousbeast" then force_mischievous()
elseif EventType=="flier" then force_flier()
elseif EventType=="siege" then force_siege()
elseif EventType=="nightcreature" then force_nightcreature()
end

I get an error when trying to run this script
"no unit selected in ui"

I tried viewing a civilization... what I really want is a caravan to show up at the moment...

update:
ok I tried viewing a unit in the unit screen.  no error, but no caravan
« Last Edit: February 03, 2013, 02:53:01 pm by thistleknot »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #77 on: February 03, 2013, 02:52:55 pm »

You select a unit, not a civilization.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #78 on: February 03, 2013, 02:53:21 pm »

updated, did, but no caravan

worked for migrants tho

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #79 on: February 03, 2013, 02:57:41 pm »

Yeah, it's a bit finicky. Try with some other civs, see if those work. I have a feeling that it may not "force" so much as "coax".

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #80 on: February 04, 2013, 09:22:58 pm »

a plugin to allow dwarf's with the cleaning labor to also autodump rotten meat!

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #81 on: February 05, 2013, 12:25:56 am »

A plugin to export the description text of item/engraving/creature you're watching, is it posible?
I think expwnent was working on something very similar.

evictedSaint

  • Bay Watcher
  • if (ANNOYED_W_FANS==true) { KILL_CHAR(rand()); }
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #82 on: February 05, 2013, 12:56:42 am »

I would appreciate the ability to turn off ghosts.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #83 on: February 05, 2013, 04:06:27 am »

An unstacking utility for seperating stacks of coins/bones/etc
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #84 on: February 09, 2013, 01:42:00 pm »

I don't quite like asking for something instead of making it myself, but I'd like for interactions/syndromes to be able to run scripts/plugins directly instead of relying on boiling stones. I have a bit of a thing I'm planning to do with Fortbent that requires reassigning a creature's soul's race ID, then checking that for various stuff, and...

i want to implement Lord English possession in the game and need DFHack to do it and I don't want user input to be required at any point

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #85 on: February 09, 2013, 01:50:25 pm »

I don't quite like asking for something instead of making it myself, but I'd like for interactions/syndromes to be able to run scripts/plugins directly instead of relying on boiling stones.

Isn't that what Autosyndrome will do?
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #86 on: February 09, 2013, 02:14:03 pm »

Autosyndrome appears to rely on boiling stones, as far as I can tell. That's what I meant.

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #87 on: February 09, 2013, 02:43:25 pm »

I thought that the purpose was to apply syndromes without dwarves having to get caught in clouds. If not, there's no difference to vanilla and it would do nothing, so it must be that it applies syndromes directly during reactions.
Logged
Dwarf Souls: Prepare to Mine
Keep Me Safe - A Girl and Her Computer (Illustrated Game)
Darkest Garden - Illustrated game. - What mysteries lie in the abandoned dark?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #88 on: February 09, 2013, 03:22:31 pm »

yes, reactions. I don't want it to involve reactions at all.

What I basically want is something that will allow this to be possible:

Code: [Select]
-- in-game use only

--Teleports the creature straight up some or to a selected position, depending on the game mode

--relies on plugin that doesn't exist yet, this is here mostly because I like writing code :V
--targets represent what I would like these to be selected with :V
--local target = CONTEXT_CREATURE
--local targetLocation = CONTEXT_LOCATION

--0 is dorf mode
if gamemode==0 then
local tileSize = {dfhack.maps.getTileSize()}
local teleportToZ = (tileSize[3])-1
target.pos.z = teleportToZ
end
--1 is adventure mode
if gamemode==1 then
local target.pos = targetLocation
end
« Last Edit: February 10, 2013, 03:48:33 am by Putnam »
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #89 on: February 10, 2013, 02:24:47 pm »

Should be possible without all that much work. I probably can't get to it any time soon, though.
Logged
Pages: 1 ... 4 5 [6] 7 8 ... 61