-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update create-unit.lua #694
base: master
Are you sure you want to change the base?
Conversation
These changes fix the errors when running the script, although it doesn't correctly create a unit when running it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you discover the meaning of anon fields, be sure to add them to the structures:
https://github.com/DFHack/df-structures/blob/master/df.world.xml#L1702
https://github.com/DFHack/df-structures/blob/master/df.ui-menus.xml#L2350
then you can refer to them in the script with proper names
It looks like there is not enough keyboard control in DF yet to make this feasible. I made a GUI version in #173 (based on some of the changes you made in this PR, so thank you for that), which should make most people happy for now. this CLI might need to be put on hold until DF brings keyboard controls back. |
Made more updates, create-unit.lua is "working" currently. |
modtools/create-unit.lua
Outdated
local spawnScreen = dfhack.gui.getCurViewscreen() -- df.viewscreen_layer_arena_creaturest | ||
gui.simulateInput(spawnScreen, 'SELECT') -- create the selected creature | ||
gui.simulateInput(spawnScreen, 'ARENA_CREATE_CREATURE') -- create the selected creature |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works? it doesn't work for me when testing manually..
These changes fix the errors when running the script, although it doesn't correctly create a unit when running it.