• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Need Info] Mirror trigger generated images

Status
Not open for further replies.
Level 9
Joined
Apr 27, 2012
Messages
228
Hello folks,

I want to create a 2d game using sprites.

Imagine it like this:
marinez.png


Note how the marine never faces left. Blizzad saved space by mirroring the images when he walks left.
I want to do that, too. I need a way to mirror imported images in Galaxy Editor.




Currently, I create a dialog (hide background) and then a dialogitem of type image. The image is then moved to the units position. And that's the image I want mirrored.



I also accept completely differnet approaches. also +rep promised ツ
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
Have you tried setting it to a negative size (widths to a negative value)? In Direct3D and OpenGL everything is positioned using vectors and matrices where a negative scale matrix quite literally will invert the image.

The question is if negative size is allowed by the dialog engine, worth a try however.

As for loading the sprite sheet... The only way I can think is to have a containing panel element which holds the sprite map image in full size however only shows a single frame. You move the sprite map in the panel to get the appropriate frame.
 
Level 9
Joined
Apr 27, 2012
Messages
228
Have you tried setting it to a negative size (widths to a negative value)? In Direct3D and OpenGL everything is positioned using vectors and matrices where a negative scale matrix quite literally will invert the image.

The question is if negative size is allowed by the dialog engine, worth a try however.

Yup, I tried, it doesn't work. It lets me enter a negative value, but in the game, the image will be invisible then.


As for loading the sprite sheet... The only way I can think is to have a containing panel element which holds the sprite map image in full size however only shows a single frame. You move the sprite map in the panel to get the appropriate frame.

Oh, don't worry, I have that figured out. I don't use a sheet, currently, but rather seperate images, but it works nicely. But I must mirror to save A LOT of disc space.


Have you tried setting it to a negative size (widths to a negative value)? In Direct3D and OpenGL everything is positioned using vectors and matrices where a negative scale matrix quite literally will invert the image.

The question is if negative size is allowed by the dialog engine, worth a try however.

About that: I've been thinking about using a custom model for this. It would have a normal and an inverted state, with the desired textures applied to it, resulting in a mirroring when it's inverted.

But for this, I'd need:

- Starcraft 2 Modeling Programm (heard sth about 3ds max11?)
- knowledge of how to give a model a replaceable Texture


anyways, any other suggestions? Help is appreciated ツ
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
Might sound stupid, but why don't you just mirror the texture?
But I must mirror to save A LOT of disc space.
To clarify, in old video games to save space with sprites they would often mirror the x axis (or y axis as well for top down games). This meant a single image could be used while still allowing movement in both directions. It works surprisingly well due to natural symmetry of most sprites.

The obvious limitation is the typical problem with mirror images. If you have a guy with a gun in his right hand walking right it will be in his left hand when walking left. Thus why characters like Mario never appeared to hold anything. However at the time this minor visual error was worth the ~50% space savings and for sprites which followed natural symmetry (nothing being held) it produced perfect results.

What he wants is a way with dialog images to mirror the image texture used on the x axis. This is not so much for him to save space (although that is great to) but for efficiency sake since the source material he has lacks unique sprites for those directions anyway. It is a waste of resource making mirrored files for something that should be as easy as a field change in a function call or even a sign change.
 
Level 9
Joined
Apr 27, 2012
Messages
228
except mirror is not rotation. Rotation of 180 degrees is the same as mirroring both X and Y axis, the result being the sprite appears upside down as well.

yes, sadly :(

Man, those Blizzard folks! I can't believe that Galaxy Editor is capable of so many feats, yet it fails to fulfil the simple task of mirroring an image. Even Game Maker can do that :p (sry)

This is a vital criterium for me. If GE can't do that, I'll find another modding plattform.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
There is something about "wrap" mentioned in the native file. It might be that with a custom UI file you can declare inverted elements.

However I would strongly recommend raising this on their US development forum on BattleNet. With some luck the SC2 dev team may see the use in mirroring and add natives for it next patch (hopefully it should not be that difficult, as it is we are surprised it cannot be done already).
 
Level 9
Joined
Apr 27, 2012
Messages
228
hey, I was just thinking: Can actors (models) be flipped around using triggers or data editor? If so, I might just use a flat model (4 vertexes forming a square :p), apply the texture to it (both sides), and when the unit walks left, flip it around (by rotating the model along the x (?) or y (?) axis).

[Imagine it like an overhead transparency with a picture on it, which is turned around, mirroring the picture :p ]


[...]
However I would strongly recommend raising this on their US development forum on BattleNet. With some luck the SC2 dev team may see the use in mirroring and add natives for it next patch (hopefully it should not be that difficult, as it is we are surprised it cannot be done already).

Will you come over there and support me? :p
 
Status
Not open for further replies.
Top