Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Heroes 3.5 - WoG and Beyond > Thread: Is it possible to measure the offset of a HD mod window?
Thread: Is it possible to measure the offset of a HD mod window?
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 09:16 AM
Edited by Archer30 at 10:37, 09 May 2020.

A new way of playing animation on adv map and question

Hi guys, I'm posting this thread on behalf of my friend @Hawaiing. He's a shy lad, afraid of sharing his great findings so I'm helping him out.

What has he got?

A new way of playing an animation on adv map

The animation from the link is a set of consistent PNGs. It plays on the window of H3 instead of "the internal way" and thus bypasses the build-in graphics limitation (8-bit BMP). By using his way it allows H3 to play some high-quality clips in-game.

And here comes his question.
Is it possible to measure the black edges of an HD window?



The idea is to trigger an animation on a certain map object. But there is one thing stopping this from happening on the HD window mode.
As we can see, the HD mod allows an H3 window to zoom freely with black edges filled in either on top/bottom or left/right to keep the game running in a fixed ratio. There seems to be no way to measure the offset of coordinates between an H3 window and the actual game content.

Let me know if you have any thought about this


Edit:
Here I uploaded another screenshot to explain my question better.



So what I have is the coordinate of the red rectangle. And I'm trying to get the coordinate of the blue rectangle instead. Usually, these 2 have the same coordinate except for HD window mode. Users are allowed to reshape the window freely thus there is an offset between red and blue.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
avatar
avatar


Promising
Supreme Hero
posted May 08, 2020 09:40 AM

Native resolution is x=800, y = 600.
I GUESS when you set in hd mod resolution x = 1280, y = 720 - x offset = (1280-800)/2 = 240 pixels.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
FirePaladin
FirePaladin


Legendary Hero
DoR Modder
posted May 08, 2020 09:57 AM

avatar said:
Native resolution is x=800, y = 600.
I GUESS when you set in hd mod resolution x = 1280, y = 720 - x offset = (1280-800)/2 = 240 pixels.


Crap, you were faster. But I'm totally okay with what you wrote.
____________
Enshackling time itself, heralds of the Ancients among their heat-depleted land.... Who could they be, who could rally the beings of the East and the North and control the mortals' fate?

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 10:18 AM
Edited by Archer30 at 10:36, 08 May 2020.

avatar said:
Native resolution is x=800, y = 600.
I GUESS when you set in hd mod resolution x = 1280, y = 720 - x offset = (1280-800)/2 = 240 pixels.


Hi, avatar! Glad you are here to help!

Although I'm afraid I did not describe my question correctly. Let me make it better. The facts:

1. The animation is played on the screen and only associated with the window, it knows nothing about the actual game resolution (aka resolution without black edges).
2. H3 window in HD can be reshaped by the user freely. It adds black edges to allow the game to run in a fixed ratio (which related to the HD resolution settings)

So here's my question again - how can we measure the black edges generated by HD mod/user?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
FirePaladin
FirePaladin


Legendary Hero
DoR Modder
posted May 08, 2020 10:44 AM
Edited by FirePaladin at 10:49, 08 May 2020.

I guess it depends upon screen size. For example, if I have 1680 x 1050 and run the game in 1369 x 856, then x offset will be equal to 311/2 (which is 155/156, but I dunno which is left/right). y offset will be 97.

So basically, (screen x - H3 x)/2= x offset
                   (screen y - H3 y)/2= y offset

Window is something else. I'll try to see what I can manage there.

Edit: I think there are programs which can do that. Tbh, one of the reasons I almost never ask anything here is because I first google my question/need.

What I found in several seconds: https://www.google.com/search?q=how+to+calculate+window+size+program&oq=how+to+calculate+window+size+program&aqs=chrome..69i57j33.10487j0j7&sourceid=chrome&ie=UTF-8

I mean, the first links look promising.
____________
Enshackling time itself, heralds of the Ancients among their heat-depleted land.... Who could they be, who could rally the beings of the East and the North and control the mortals' fate?

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 11:11 AM
Edited by Archer30 at 11:57, 08 May 2020.

Firepaladin, thanks for your reply!

I have 0 issues with playing an animation on full screen, the black edge is only for windows mode in HD (as you can see from my screenshot in the first post).

I have also no problem with the coordinates of the window. The animation could be set to play in the H3 window.

The only question is, between the H3 window and the actual H3 game -> there are black edges.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 11:14 AM

Okay, I start to believe my question is very confusing...

Let me ask another question - is it possible to play a def on adv map?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
FirePaladin
FirePaladin


Legendary Hero
DoR Modder
posted May 08, 2020 11:15 AM
Edited by FirePaladin at 11:16, 08 May 2020.

Archer30 said:
Okay, I start to believe my question is very confusing...

Let me ask another question - is it possible to play a def on adv map?


Everything on adv map is a def (probably except for non-animated objects, but I don't remember for sure).
____________
Enshackling time itself, heralds of the Ancients among their heat-depleted land.... Who could they be, who could rally the beings of the East and the North and control the mortals' fate?

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 11:19 AM
Edited by Archer30 at 11:20, 08 May 2020.

FirePaladin said:


Everything on adv map is a def (probably except for non-animated objects, but I don't remember for sure).


Right. Is there a way to play a def as I showed in the first post? The idea is to give animation to adv magic.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
FirePaladin
FirePaladin


Legendary Hero
DoR Modder
posted May 08, 2020 11:23 AM

Archer30 said:
FirePaladin said:


Everything on adv map is a def (probably except for non-animated objects, but I don't remember for sure).


Right. Is there a way to play a def as I showed in the first post? The idea is to give animation to adv magic.


So, I see you're playing WoG. I think it should be possible somehow, but don't ask me, 'cus the only thing I know about ERM is that it's a programming language used by ERA 2 and has lots of numbers in it.
____________
Enshackling time itself, heralds of the Ancients among their heat-depleted land.... Who could they be, who could rally the beings of the East and the North and control the mortals' fate?

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 11:45 AM
Edited by Archer30 at 12:00, 08 May 2020.

FirePaladin,

Yes, I'm looking for an erm solution for playing a def on adv map. Didn't see such a thing from erm help.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted May 08, 2020 12:52 PM
Edited by Salamandre at 12:53, 08 May 2020.

I don't know what you mean by "playing a def". All defs play on adventure map, once they are placed, the frames succeed in a loop, that's playing.
Or you mean place a new def during the game and play it? That also works with erm commands.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 12:58 PM
Edited by Archer30 at 13:03, 08 May 2020.

Salamandre said:
I don't know what you mean by "playing a def". All defs play on adventure map, once they are placed, the frames succeed in a loop, that's playing.
Or you mean place a new def during the game and play it? That also works with erm commands.


Thanks, Sal. Exactly! Could you kindly provide an erm example of playing a new def on adv map please?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
FirePaladin
FirePaladin


Legendary Hero
DoR Modder
posted May 08, 2020 01:02 PM

Salamandre said:
I don't know what you mean by "playing a def". All defs play on adventure map, once they are placed, the frames succeed in a loop, that's playing.
Or you mean place a new def during the game and play it? That also works with erm commands.


Yeah, but I guess archer here wants it to play the def only for a short time after the spell is cast, not in a loop, right?
____________
Enshackling time itself, heralds of the Ancients among their heat-depleted land.... Who could they be, who could rally the beings of the East and the North and control the mortals' fate?

 Send Instant Message | Send E-Mail | View Profile | PP | Quote Reply | Link
Archer30
Archer30


Adventuring Hero
posted May 08, 2020 01:05 PM

FirePaladin said:

Yeah, but I guess archer here wants it to play the def only for a short time after the spell is cast, not in a loop, right?


Exactly!

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Salamandre
Salamandre


Admirable
Omnipresent Hero
Wog refugee
posted May 08, 2020 01:08 PM

No way with erm, at least from what I know. Tried also in Atlantis this idea, the loop couldn't be controlled.


____________
Era II mods and utilities

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0446 seconds