Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - FranchuFranchu

Pages: [1]
1
Utilities and 3rd Party Applications / DF table gui explorer. [DFHack]
« on: October 30, 2018, 03:17:18 pm »
This is a DFHack script for DFHack script developers to view the "df" table easier
https://www.dropbox.com/s/kszv9cdkc5e4afu/guidf.lua?dl=1

2
Finally, a way to do it
Code: [Select]
function index(ls,arg)
    for i,j in ipairs(ls) do
        if j == arg then return i end
    end
    qerror('Oops, something internal went wrong')
end
if dfhack.gui.getSelectedUnit() then
    unit = dfhack.gui.getSelectedUnit()
    active = df.global.world.units.active
    ni = index(active,unit)
    newadv = active[ni]
    adv = active[0]
    active[0] = newadv
    active[ni] = adv
    print('Correctly bodyswapped!')
end
Copy-paste it in a .lua file, put it on hack/scripts and enjoy

Pages: [1]