Created
October 9, 2013 16:17
-
-
Save Rumrusher/6903877 to your computer and use it in GitHub Desktop.
CHOOSE YOUR MOUNTS
To apply this you need to go into the unit's profile in adventure mode, fort mode is just highlight and enter.
first pick is Rider, the second is mount, this code is a modify version of Hugelueman's marry revise code... also warmists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Mount (rider,horse) | |
--for k,horse in pairs(unit_list) do | |
--if unit_rider.pos.x==horse.pos.x and unit_rider.pos.y==horse.pos.y | |
--and unit_rider.pos.z==horse.pos.z then --check if they are on the same tile | |
horse.general_refs:insert("#",{new=df.general_ref_unit_riderst,unit_id=rider.id}) | |
rider.relations.rider_mount_id=horse.id | |
rider.flags1.rider=true | |
horse.flags1.ridden=true | |
require("utils").insert_sorted(df.global.world.units.other.ANY_RIDER,rider,"id") | |
return | |
end | |
unit_1 = dfhack.gui.getSelectedUnit() | |
if unit_1 == nil then | |
print ("You must place the cursor over the first target.") | |
return | |
end | |
print("Target the Mount and press enter") | |
test = dfhack.lineedit("") | |
unit_2 = dfhack.gui.getSelectedUnit() | |
if unit_2 == nil then | |
print ("You must place the cursor over the second target.") | |
return | |
end | |
dfhack.with_suspend(Mount, unit_1, unit_2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment