Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 23 24 [25] 26 27 ... 61

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

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #360 on: January 03, 2014, 08:33:17 pm »

atom-smasher is still not made, i'm reluctant to do it, coz is much work to figure out all that stuff with materials (well maybe not that much). We could see what is the performance drain though, coz it would need to iterate through items (in 16x16 area) and units (all?).
btw the dragon breath shooting mechanical workshop uses magma (or water if that is available, but then it's not that impressive...)
next up: remote controlled golems? too much work
Of course workshop "using" magma water is hard-ish. Because a) it's easy to make workshop require magma/water (but at which tile?) b) what will use that magma/water, usually reaction, so reaction, not workshop is magma using c) usual raw-reactions will get more and more complicated when you want to type out: allow this reaction only when water/magma is at x=<> y=<> z=<> and then remove X water/magma.
btw in lua this is magma/get set function i'm using:
Code: [Select]
function getMagma(pos)
local flags=dfhack.maps.getTileFlags(pos)
return flags.liquid_type, flags.flow_size
end
function removeLiquid(pos)
local flags=dfhack.maps.getTileFlags(pos)
flags.flow_size=0 --could be just removing 1 or 2 etc...
dfhack.maps.enableBlockUpdates(dfhack.maps.getBlock(pos.x/16,pos.y/16,pos.z),true) --needed to restart the flow sometimes
end
« Last Edit: January 03, 2014, 09:12:36 pm by Warmist »
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [SUGGESTIONS] for DFhack plugins
« Reply #361 on: January 03, 2014, 09:14:29 pm »

A filling station would be nice, because you probably have done all the work already, just have to delete some parts. Some workshop that takes magma/water and uses it up in the reaction. The product would be a container with magma/water in it.

I currently use just reactions, and people can fill unlimited containers with 1 tile of 7/7 magma under the workshop.  :-\

The atomsmasher sounded nice, because you can just dump stuff on it, but its not a new game mechanic to destroy items. It can be done with reactions, just slower. Or with actual atom smashers. If its a lot of work, I would rather focus on something were the people will say: Wow!, I always wanted one of these. (Like the dragonfire engine)

But the biggest thing is the powered workshops. IndigoFenix will love those, and Deon for his fallout mod as well. And Narhiril for the tech-tree of LfR. :)

EDIT: Just saw your edit: I thought the code for that was already done? Because the steam engine uses up magma with each reaction. ? I honestly thought you would just have to delete the "create power" part and recompile it.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #362 on: January 03, 2014, 09:34:20 pm »

But then you will have a workshop that consumes b boiling water item and does not give anything. Steam engine is like a masterpiece. As is siege engine plugin and other stuff by angavrilov.

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #363 on: January 03, 2014, 09:35:46 pm »

The display case does look like something every player could use, regardless of mod or not.
If that's what you see when you q over the display case, I'd use it.
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.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [SUGGESTIONS] for DFhack plugins
« Reply #364 on: January 03, 2014, 11:09:47 pm »

But then you will have a workshop that consumes b boiling water item and does not give anything. Steam engine is like a masterpiece. As is siege engine plugin and other stuff by angavrilov.
As you know I have no knowledge about C++, I just thought it could be easily altered. If it doesnt work that way, no problem. I am more than excited enough about the powered workshops. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Urist Imiknorris

  • Bay Watcher
  • In the flesh, on the phone and in your account...
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #365 on: January 04, 2014, 01:32:19 am »

I've looked for this everywhere but can't find it. Has anyone made a way to make melting of objects return their full metal quantity?
Logged
Quote from: LordSlowpoke
I don't know how it works. It does.
Quote from: Jim Groovester
YOU CANT NOT HAVE SUSPECTS IN A GAME OF MAFIA

ITS THE WHOLE POINT OF THE GAME
Quote from: Cheeetar
If Tiruin redirected the lynch, then this means that, and... the Illuminati! Of course!

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #366 on: January 04, 2014, 02:55:57 am »

But then you will have a workshop that consumes b boiling water item and does not give anything. Steam engine is like a masterpiece. As is siege engine plugin and other stuff by angavrilov.
As you know I have no knowledge about C++, I just thought it could be easily altered. If it doesnt work that way, no problem. I am more than excited enough about the powered workshops. :)

It's not so much about the C++ as the game's data structures, which are in XML here.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [SUGGESTIONS] for DFhack plugins
« Reply #367 on: January 04, 2014, 06:49:58 am »

Warmist, I found something that you could do, if you wanted to:

Change the createitem plugin to accept coordinates/location, so that people can call it with autosyndrome in a workshop. Yes, it only creates items, which is things you can already do in workshops, but hear me out. McTeellox has written probability-syndrome, which allows things like this:

PRODUCT:100:1:probability-syndrome
PRODUCT:50:1:x
PRODUCT:50:1:y

This reaction would create EITHER product x OR product y. Not none, one, or two of them. But it cant affect the items ingame, only autosyndrome. Its a bit hacky, but if probability-syndrome calls autosyndrome that calls create-items, we would get a new function for all reaction that create items. In all mods. We can finally do a IF/ELSE in reactions. IF product 1 is created, do this, IFELSE make product 2, ELSE make product 3.

And all it would require it the createitem plugin that accepts \LOCATION when called with autosyndrome. I so hope thats possible.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #368 on: January 04, 2014, 10:09:38 am »

i think new version will have position, though not sure.
also useless stuff continues

Edit: playing with it enabled it's not so great, needs a lot more work to be nice. But it's test/demonstration of few ideas: autogenerated jobs, maybe praying could be like that, you can't order dwarves to pray. Also it could be used in many other places because it's not limited to dwarves (any unit can do those jobs). Another test was about holding info in buildings and displaying it. And third was history writing idea pre-test, main idea being dwarves writing pages of history events/facts, and player composes books, then places in bookshelves which you can look over or export.
« Last Edit: January 04, 2014, 12:42:31 pm by Warmist »
Logged

WillowLuman

  • Bay Watcher
  • They/Them Life is weird
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #369 on: January 04, 2014, 02:28:33 pm »

We could use a plugin that allows doctors to treat patients with specific substances, making syndrome-based medicine possible without complicated setups.
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?

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #370 on: January 04, 2014, 04:27:32 pm »

We could use a plugin that allows doctors to treat patients with specific substances, making syndrome-based medicine possible without complicated setups.
Code: [Select]
--reaction:
[REACTION:LUA_HOOK_CURE_BLA]
[NAME:Adminster cure for bla]
[PRODUCT:0:1:LIQUID_MISC:NONE:WATER][PRODUCT_DIMENSION:2000]
--lua file:
function lookUpSyndrome(name)
    for k,v in pairs(df.global.world.raws.syndromes.all) do
        if v.syn_name==name then
            return v,k
        end
    end
end
function hasDisease(unit,syndrome)
    for k,v in pairs(unit.syndromes.active) do
        if v.type==syndrome.id then
            return true
        end
    end
    return false
end
function cureDisease(unit,syndrome)
    for k,v in pairs(unit.syndromes.active) do
        if v.type==syndrome.id then
            local todel=v
            unit.syndromes.active:erase(k)
            todel:delete()
            return true
        end
    end
    return false
end
function cureBla(reaction,unit)
    local dx,dy,dz
    local syndrome="BLA" --change this to suit your needs, or better yet make it into function parameter
    local syn_raw=lookUpSyndrome(syndrome)
    for k,v in pairs(df.global.world.units.active) do
        if v~=unit and not v.flags1.dead and hasDisease(unit,syn_raw) then --work on alive, sick units and not himself (well maybe you could let him cure himself)
            dx=v.pos.x-unit.pos.x
            dy=v.pos.y-unit.pos.y
            dz=v.pos.z-unit.pos.z
            if dx*dx+dy*dy<3 and dz==0 then --work on only close units
                cureDisease(unit,syn_raw)
                return
            end
        end
    end
end
require("plugins.eventful").registerReaction("LUA_HOOK_CURE_BLA",cureBla)
lua file must be placed in to init.lua (in raw folder) or in some other file and called from that raw/init.lua file with dofile("path/to/file.lua")

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: [SUGGESTIONS] for DFhack plugins
« Reply #371 on: January 04, 2014, 09:32:01 pm »

Quote
autogenerated jobs, maybe praying could be like that
Or, more mundane thought: toilets. casinos. music stage. tavern. General non-productive socialising stuff.

Or productive things: If its truly reactions that are done by idle dwarves at random, people could build smoking lounges and libraries and gardens... urists reads a book, gains some skill-gain, urists smokes a pipe, runs "remove bad thoughts"...

EDIT: About that display stand: Could signs be added? Custom 1 tile workshop, and it displays a text that the player can enter? I know notes are already in the game, but it would be something with more atmosphere.
« Last Edit: January 06, 2014, 10:28:20 am by Meph »
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #372 on: January 06, 2014, 06:16:44 pm »

Quote
autogenerated jobs, maybe praying could be like that
Or, more mundane thought: toilets. casinos. music stage. tavern. General non-productive socialising stuff.

Or productive things: If its truly reactions that are done by idle dwarves at random, people could build smoking lounges and libraries and gardens... urists reads a book, gains some skill-gain, urists smokes a pipe, runs "remove bad thoughts"...

EDIT: About that display stand: Could signs be added? Custom 1 tile workshop, and it displays a text that the player can enter? I know notes are already in the game, but it would be something with more atmosphere.
yeah we can do that with slabs (i.e. workshop will need a slab to hold the text :) ). Also slabs have a type (used in adventurer mode):
Code: [Select]
        Slab ,
        Memorial,
        CraftShopSign,
        WeaponsmithShopSign,
        ArmorsmithShopSign,
        GeneralStoreSign,
        FoodShopSign,
        /**
         * from the gods?
         */
        Slab2,
        FoodImportsSign,
        ClothingImportsSign,
        GeneralImportsSign,
        ClothShopSign,
        LeatherShopSign,
        WovenClothingShopSign,
        LeatherClothingShopSign,
        BoneCarverShopSign,
        GemCutterShopSign,
        WeaponsmithShopSign2,
        BowyerShopSign,
        BlacksmithShopSign,
        ArmorsmithShopSign2,
        MetalCraftShopSign,
        LeatherGoodsShopSign,
        CarpenterShopSign,
        StoneFurnitureShopSign,
        MetalFurnitureShopSign
We could also use that for something.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #373 on: January 06, 2014, 10:40:51 pm »

sorry for any deralings...

a dfhack plugin that would zero out artifact values.  That way I can play longer without epic sieges.

uPDATE:
I do see a feature to disable artifacts in d_init.txt...

although I did like the benefit of legendary (skills &) equipment.  I just hated I couldn't sell it off.  Trying to atom smash them is difficult as I cannot build an artifact item on top of a bridge or under an open one...  but this should suffice
« Last Edit: January 06, 2014, 10:46:07 pm by thistleknot »
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [SUGGESTIONS] for DFhack plugins
« Reply #374 on: January 06, 2014, 10:45:56 pm »

No. Value looks like some sort of function of quality and material.
Pages: 1 ... 23 24 [25] 26 27 ... 61