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

Custom sprites #1001

Merged
merged 45 commits into from
Oct 28, 2021
Merged

Custom sprites #1001

merged 45 commits into from
Oct 28, 2021

Conversation

SimLV
Copy link
Contributor

@SimLV SimLV commented Apr 6, 2021

It is now possible to create custom objects using objects.cgf + tga images.
Tga images should be exported with 8bit keeper palette, no RLE and origin "top-left".
Image size restrictions more than 8x8 and less than 256x256

@SimLV
Copy link
Contributor Author

SimLV commented Apr 6, 2021

I want to add another options i.e. multiple sprites per image and support for rotation.

  • Topdown mode should be checked

@SimLV SimLV marked this pull request as ready for review April 9, 2021 19:36
Copy link
Member

@Loobinex Loobinex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You committed the custom image, that needs to be removed before merging the pull too.

config/fxdata/objects.cfg Outdated Show resolved Hide resolved
config/fxdata/objects.cfg Outdated Show resolved Hide resolved
src/config.c Outdated Show resolved Hide resolved
src/thing_objects.c Outdated Show resolved Hide resolved
src/thing_objects.c Outdated Show resolved Hide resolved
Copy link
Member

@Loobinex Loobinex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it, and the single object works, but just one perspective and just the single frame. With this pull is it already possible to create an object with multiple perspectives and/or multiple frames, and if so, how would I do that?

config/fxdata/objects.cfg Outdated Show resolved Hide resolved
config/fxdata/objects.cfg Outdated Show resolved Hide resolved
config/fxdata/objects.cfg Outdated Show resolved Hide resolved
Copy link
Member

@Loobinex Loobinex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've yet to be able to use the custom objects beyond them being decorative.

Please install this map pack and load the only map: traptest.zip

  1. Build a workshop and rooms to get units
  2. Use units to construct a trap
    -> Notice the trapbox is the custom object as defined in the custom trap and object configs
  3. Place the trap
    -> Notice that imps will refuse to place the trap, they should.

Copy link
Member

@Loobinex Loobinex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed on discord, the current implementation is very limited in that it only provides one angle and one frame, making the use case very limited. Since it's better than nothing, I could accept it in it's current form, but allowing sprite sheets (in png or tga) would make the feature a lot more useful.

src/config_objects.c Outdated Show resolved Hide resolved
src/config_objects.c Outdated Show resolved Hide resolved
Copy link
Member

@Loobinex Loobinex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

I've found a bug with the custom object. I added it to the map, and it gets placed at the wrong location. See image:
https://user-images.githubusercontent.com/13840686/116010557-07812300-a620-11eb-9e67-d62326b4c2c0.png

The AP where the object is placed is in the center of the room, the object itself is placed far off center.

To reproduce, install the map pack and load map 1001. See the object is not placed at the AP.
Mappack: traptest.zip

Copy link
Member

@Loobinex Loobinex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved

Other bug:

Custom objects fail to properly work on custom campaigns at all. To test, try to reproduce the bug from the previous comment and notice the object is not placed at all.
To get it to work, you have to copy the mbox.tga and objects.cfg files from \levels\traptest_cfgs to \fxdata.

@Loobinex
Copy link
Member

Sprite with perspective:
image
image

# Conflicts:
#	config/fxdata/objects.cfg
#	src/config_objects.c
#	src/config_rules.c
#	src/thing_objects.c
#	src/thing_objects.h
so now objects are animated
src/custom_sprites.c Outdated Show resolved Hide resolved
@SimLV
Copy link
Contributor Author

SimLV commented Sep 12, 2021

map00301.zip
an example of map-defined object with json.

@Loobinex
Copy link
Member

To test with: dkknightstatuecameras.zip
A dark knight with all sides
FPbr_0004

@Loobinex Loobinex self-requested a review September 13, 2021 19:49
@Loobinex Loobinex dismissed their stale review September 13, 2021 19:50

Feature has been overhauled. Will do a new review.

@Loobinex
Copy link
Member

Loobinex commented Oct 27, 2021

The dwarf from opengameart.org: gimly.zip
The armorstand from trotim: armorstand.zip
Banner from trotim: banner.zip
Banner but windy: windbanner.zip (use AnimationSpeed 10 or 15)
Guardpostflag in white: whiteflag.zip

@Loobinex Loobinex merged commit 18059bb into dkfans:master Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants