Record macros

Started by Sion, March 29, 2014, 03:21:28 PM

Previous topic - Next topic

Sion

This idea comes directly from Dwarf Fortress, there you can record and store several macros that can reproduce repetitive tasks, like designate mining to build bedrooms.
So many ideas... so little time...
Silence is the worst answer.

DanGio


Sion

It probably would be kind of easy to make (for someone with the skills of Tynan at least), all it needs to do I record what buttons (eg: wall type: metal wall) have been pressed and the relative distances on the map from the starting position.

So lets say we have a room that looks like this:
W = Wall
D = Door
B = Bed
L = standing Lamp










WWWDWWW
WLW
WW
WBW
WBW
WW
WW
WWWWWWW

Lets also say that the door is the first thing that is placed while the "Record macro" is running, so that is the relative starting position, that means that:
everything to the right of the door would be +X
everything to the left of the door is -X
and everything above the door is +Y
and everything below the door is -Y
Like this:






+Y
A
|
-X<--0-->+X
|
V
-Y

Lets say that the building is built in this order:
1: Door
2: Walls
3: Bed
4: Lamp

Then the recorded macro file would look something like this: (pseudo code)

(macro start)
select Iron_door
relative start = <map.get(x_coordinates)><map.get(y_coordinates)>
button Lmouse=pressed @start
button Lmouse=released @start

select Iron_Wall
button Lmouse=pressed @start-1X
button Lmouse=released @start-3X

button Lmouse=pressed @start-3X-1Y
button Lmouse=released @start-3X-7Y

button Lmouse=pressed @start-3X-7Y
button Lmouse=released @start+3X-7Y

button Lmouse=pressed @start+3X-6Y
button Lmouse=released @start+3X

button Lmouse=pressed @start+3X
button Lmouse=released @start+1X

Select Bed
button Lmouse=pressed @start-3Y (rotation down)
button Lmouse=released @start-3Y

Select Standing_Lamp
button Lmouse=pressed @start+2X-1Y
button Lmouse=released @start+2X-1Y
(macro end)




When you then want to replay the macro you just need to select witch macro to run from a list of previously recorded macros, and click on the map where you want the door to be, and (blueprints of) the  structure would be placed almost immediately.

this is especially useful when you want to replicate large or complicated structures or simply replicate the same structure many times (imagine building a village with round houses without this)




There could also be a macro editor that the user could use if/when the user have become more familiar to how macros work, then (s)he could use it to optimize the macros because it is likely that some unintentional things are caught while recording, eg, build a wall to long an need to delete a part, that would be recorded and played every time, with a editor the macro could be corrected.
So many ideas... so little time...
Silence is the worst answer.

Sion

I think this post deserves a little more attention.
So many ideas... so little time...
Silence is the worst answer.

StorymasterQ

Yes. If this is going to be Dwarf Fortress IN SPACE (and it's on its way there, don't either doubt or deny it) macros will be a great addition.
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. - Myself

The dubious quotes list is now public. See it here