Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Military Uniforms  (Read 5163 times)

Mickey Blue

  • Bay Watcher
    • View Profile
Military Uniforms
« on: February 02, 2012, 03:14:33 pm »

Is there way to set up and save military uniform configurations or are they simply hard-coded in? I use military as my primary/only defense and its frustrating every fort to have to create new uniform configurations.
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #1 on: February 02, 2012, 03:24:59 pm »

You could make one or more macros to make your uniform assignments. That way, you'd only have to make the proper uniform once when you record it, then you can just load and run the macro when you have a new fort. My "fort startup" macro includes deleting the original uniform sets and making a bronze axeman uniform, so I know it works.

There might be a few problems with different numbers of leather types in different worlds due to different numbers of boogiemen and forgotten beasts, but as long as you don't ever scroll past those it shouldn't be a problem (just scroll up off the top to get by them).
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Mickey Blue

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #2 on: February 02, 2012, 03:52:31 pm »

Stupid question but how do you make a macro?
Logged

NecroRebel

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #3 on: February 02, 2012, 05:12:48 pm »

Hitting ctrl-r makes the game start recording your keystrokes, and the game will continue recording them until you hit ctrl-r a second time. Then, you can hit ctrl-p to play the currently-active macro, ctrl-s to save the macro (this will bring up a box that lets you name it), and ctrl-l to load a saved macro. Basically, you just hit ctrl-r and make the uniform, then hit ctrl-r and ctrl-s and you're done.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Mickey Blue

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #4 on: February 02, 2012, 06:35:41 pm »

Wow.. I've been playing for years and never known that.. I always wondered what that command was for.

Thanks for the info.
Logged

Mickey Blue

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #5 on: February 02, 2012, 07:25:11 pm »

One more related question; if you try to equip multiple weapons will the units choose their preference or will they just pick the first?
Logged

Rude

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #6 on: February 02, 2012, 07:28:58 pm »

They will probably (try) dual wielding them. failing that, they'll just carry the extras around.
Logged

Mickey Blue

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #7 on: February 02, 2012, 07:35:57 pm »

Gottcha, shame, generally I prefer to separate my military by class of weapons (bladed, blunt, pierce, etc), but I'll continue making one for each specific weapon.

Thanks again for all the info, made my first macro, big milestone.
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: Military Uniforms
« Reply #8 on: February 02, 2012, 07:44:15 pm »

It's probably more efficient to only use one specific weapon per squad anyway, since they won't spend time teaching each other to use multiple types of weapons.

If you do want to mix weapons but by class, you can manually specify them on a per dwarf basis (don't recall the specific interface actions to take for this).  Thus you could have a squad with warhammers and maces, by specifying a hammer or mace on a specific dwarf and not specifying a weapon on the uniform.
Logged
Through pain, I find wisdom.

Mickey Blue

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #9 on: February 02, 2012, 07:54:29 pm »

Good point.
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Military Uniforms
« Reply #10 on: February 03, 2012, 01:03:25 pm »

Just a thing on making macro's here. After you have made a macro you will want to save DF and then go into the the data/init/macros/*your macro name here*.mak and open it with a text editor. In there you will see a huge list of commands given for each button press of the macro. You then want to delete all of the extra commands that are under each "group" of commands that you won't be using. It's rather time consuming to do, but after you have done it your macros will run 10-20 times faster then before. I've had macros that normally take a minute to run drop down to under 5 seconds by doing this. And with longer macros this can take your starting up of the game from "time to go make a sandwich while this macro runs" to "hit the button and wait 20 seconds while the screen becomes a blur".
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Rude

  • Bay Watcher
    • View Profile
Re: Military Uniforms
« Reply #11 on: February 03, 2012, 04:58:06 pm »

you could put "user choice: melee" in the uniform. They will theoretically pick the most expensive weapon they have the most skill with. (I don't know the exact preference priority though)
Logged

Poindexterity

  • Bay Watcher
  • Listen to my album at www.oldschoolpoindexter.com
    • View Profile
Re: Military Uniforms
« Reply #12 on: February 03, 2012, 06:24:55 pm »

You then want to delete all of the extra commands that are under each "group" of commands that you won't be using.

could you describe this process in a bit more detail.
im not certain i follow you.
examples would be nice.
Logged
Life (in dwarf fortress) is a cocophany of flavours, each more succulent than the last - why not sample them all?!

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Military Uniforms
« Reply #13 on: February 03, 2012, 06:47:14 pm »

So lets say that I create a new macro that I want to select the "mine (d)" command from the designate menu, start the designation, move upwards two tiles, and then end the designation. I'm going to name my macro "tester" in this case. Then when I open the tester.mak file in the macros folder I see this.
Code: [Select]
tester
OPTION4
CUSTOM_D
WORLD_PARAM_DELETE
LEGENDS_EXPORT_DETAILED_MAP
A_COMBAT_DODGE
A_STATUS_DESC
A_SLEEP_DAWN
A_INV_DROP
A_BARTER_CURRENCY_3
SETUP_NOTES_DELETE_NOTE
BUILDJOB_TARGET_RIGHT
BUILDJOB_BED_DORMITORY
BUILDJOB_FARM_WINTER
BUILDJOB_RACKSTAND_KILL2
HOTKEY_BUILDING_DOOR
HOTKEY_BUILDING_CONSTRUCTION_STAIR_DOWN
HOTKEY_BUILDING_WORKSHOP_DYER
BUILDING_ORIENT_RIGHT
BUILDING_ADVANCE_STAGE
BUILDING_TRIGGER_MAX_SIZE_DOWN
HOTKEY_GLASS_DOOR
HOTKEY_CARPENTER_DOOR
HOTKEY_MASON_DOOR
HOTKEY_TRAP_DOOR
BUILDJOB_STOCKPILE_DELETE_CHILD
STOCKPILE_ARMOR
STOCKPILE_SETTINGS_DISABLE
STORES_DUMP
ORDERS_DYED_CLOTH
ORDERS_ZONE_DRINKING
D_DESIGNATE
D_BURROWS_DELETE
D_NOTE_DELETE
D_NOTE_ROUTE_DELETE
D_BITEM_DUMP
D_LOOK_DUMP
ARENA_CREATURE_SIDE_UP
ASSIGNTRADE_SORT
DESIGNATE_DUMP
DESIGNATE_DIG
ITEM_DUMP
D_MILITARY_DISBAND_SQUAD
D_MILITARY_ALERTS_DELETE
D_MILITARY_AMMUNITION_REMOVE_ITEM
D_MILITARY_DELETE_UNIFORM
STRING_A100
End of group
SELECT
CLOSE_MEGA_ANNOUNCEMENT
WORLD_PARAM_ENTER_VALUE
SETUPGAME_SAVE_PROFILE_GO
D_BURROWS_DEFINE
D_MILITARY_ALERTS_SET
End of group
STANDARDSCROLL_UP
CURSOR_UP
A_MOVE_N
End of group
STANDARDSCROLL_UP
CURSOR_UP
A_MOVE_N
End of group
SELECT
CLOSE_MEGA_ANNOUNCEMENT
WORLD_PARAM_ENTER_VALUE
SETUPGAME_SAVE_PROFILE_GO
D_BURROWS_DEFINE
D_MILITARY_ALERTS_SET
End of group
CUSTOM_CTRL_R
End of group
End of macro
The majority of the "commands" given in each "group" (Notice the "End of group" tags? Each group is equivalent to one key press in the macro) are not needed, yet they still take up processing time for the game. When I use this macro I'm always going to be using the 'd' key to select mine on the designate menu, I'm never going to be using 'd' to delete a world parameter. Yet the game still tries to perform this command when I run the macro, slowing it down immensely. If I chop out all of the extra stuff recorded in the macro then it goes from what I had listed above down to:
Code: [Select]
tester
DESIGNATE_DIG
End of group
SELECT
End of group
CURSOR_UP
End of group
CURSOR_UP
End of group
SELECT
End of group
End of macro
See how much smaller that is? It even completely removes the "CUSTOM_CTRL_R" command at the end of the macro which is not needed. This will speed up the rate at which the game performs macros immensely, though it can be a little time consuming to edit larger macros. (The find/replace all tool is great for this, if every time you hit 'd' you want to select dig from the designations menu you can simply say find "huge list for the 'd' key" and then replace them all with DESIGNATE_DIG). Also one last side effect of doing this is if you accidentally activate the macro while you are on the wrong screen then it will do absolutely nothing! No more will you watch in horror as your "set up a military" macro offers away 2/3rds of your crafts because you accidentally activated it in the trade depot.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Military Uniforms
« Reply #14 on: February 03, 2012, 07:05:59 pm »

I am an idiot.

A: I thought the ctrl R is for videos.
B: I thought macros are for quickfort/chromafort
C: Someone asked me about Uniform templates for my mod, and I said: Impossible.

I thank both of you, for asking questions that I did not think of, and giving the right answers, I was looking for without even knowing.

I will definetly add macros to my mod now :)
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 :::
Pages: [1] 2