Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update create-unit.lua #694

wants to merge 4 commits into from

Conversation

Thazzeus
Copy link

These changes fix the errors when running the script, although it doesn't correctly create a unit when running it.

These changes fix the errors when running the script, although it doesn't correctly create a unit when running it.
Copy link
Member

@myk002 myk002 left a 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

@myk002
Copy link
Member

myk002 commented May 23, 2023

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.

@Thazzeus
Copy link
Author

Made more updates, create-unit.lua is "working" currently.

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
Copy link
Member

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..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants