-
Notifications
You must be signed in to change notification settings - Fork 481
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
Add graphics support for building-hacks #4380
base: develop
Are you sure you want to change the base?
Conversation
Can the plugin automatically enable itself if it detects that it is used in the raws, the same way that
as useful as
it depends which tile ids you're getting. will it be a vanilla texpos or one added by DFHack? |
It depends: for basic functionality it should be possible. It can be split in a few different things that this plugin does:
It's vanilla texpos but e.g. you do:
and then you need yet another tile for animated part. Or you need to do something similar in the lua part. |
for looking up the graphics tile from a loaded page, I think you'd use |
714c6ce
to
0c5c753
Compare
So api is still terrible but less so. The rest of stuff doesn't matter that much, so i think i'll add (or at least try to add) automagical way of this loading stuff from raws and auto-enabling itself. In perfect case having a line Another issue that plagues this module for many years: buildings need to built in specific order to connect to machines... |
0391bfc
to
a59a3d3
Compare
This is now relatively done. Needs more testing. The "make it work from raws" is a separate project and probably lua only. |
|
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.
reviewed docs and lifecycle code; will review business logic once some questions are answered.
- could you add a changelog entry for the update?
- could you update docs/plugins/building-hacks.rst and replace the "unavailable" tag with "fort gameplay buildings". Maybe "adventure fort gameplay buildings" if it's intended to work in adventure mode too.
- we need a full example of the RAWs and scripts for how to make this all work. It could be added to the modding guide as a case study. You could link to the modding guide from both the Lua API docs and buiding-hacks.rst.
docs/dev/Lua API.rst
Outdated
:make_graphics_too: replace same tiles in graphics mode with tiles from vanilla df mechanism | ||
:frame_skip: How many ticks to display one frame. If set to negative number (or skipped) frames | ||
are synchronized with machine animation. | ||
:gear_tiles: Optional array of 2 or 4 indexes. First two define ascii tiles and next two graphics tiles |
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.
is this for overriding the default gear graphics? If so, that should be communicated.
------ | ||
|
||
This module exports two events. However only one is documented here and is intended to be used directly. To use | ||
``onUpdateAction`` instead call ``setOnUpdate`` function. |
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.
why does onUpdateAction exist as a Lua event, then?
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.
The plugin lua part still uses that event (i.e. setOnUpdate
function)
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.
I'm not convinced this is sufficient reasoning. Why do you need a lua event to communicate with your own Lua layer? Why can't you call the Lua functions directly?
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.
needs changelog entry
I added some code examples in my comments to show what my understanding is of how these functions are to be used. If the examples are wrong, then I didn't understand something important.
docs/dev/Lua API.rst
Outdated
|
||
:name: | ||
custom workshop id e.g. ``SOAPMAKER`` | ||
Set workshop to be included in zones (such as bedroom or inn). |
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.
Would it be a good idea to always allow the building to be ownable? If in zone, and zone owned, then building owned?
------ | ||
|
||
This module exports two events. However only one is documented here and is intended to be used directly. To use | ||
``onUpdateAction`` instead call ``setOnUpdate`` function. |
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.
I'm not convinced this is sufficient reasoning. Why do you need a lua event to communicate with your own Lua layer? Why can't you call the Lua functions directly?
how is this coming along? I'm looking forward to using dragon fire spitters in my base defense : ) |
313469b
to
135c802
Compare
What's the status on this? I got an inquiry about |
I'm stuck in factorio land, but it's functionally done but needs to address Myk002's review issues. Also I should upload example project with everything. There might be something broken by struct changes or something else. I'll try to find some time |
135c802
to
38daeb1
Compare
…ints and animation
Co-authored-by: Myk <[email protected]>
docs: minor changes
… args for gear char/tile
31d0655
to
f2c038d
Compare
This intends to reenable building-hacks namely machine workshops with animations.
Things to consider:
Edit: less theoretical musings, more "works for now" logic.
make stuff automagically work from rawsmoved to a lua only module (different pull req later)