Template IsWar3Minimized

Troll-Brain

You can change this now in User CP.
Reaction score
85
It needs a short periodic timer for that, maybe a bit overskilled.
Hmm i could use a (static) if and boolean, in order to let the user decide.

EDIT : No it simply needs a second timer with a shorter period than the main one, with a 0.03 s margin or so :thup:
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
I will be away from computers for 1 or 2 week(s), so don't graveyard it, i will finish it when i will be back.
 

Risen

New Member
Reaction score
4
Mind adding "call DestroyTimer( GetExpiredTimer() )" to the end of function handler. For the newbs.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Does this work for Macs?
I would say "yes".
If it doesn't work, we get an other way do desync mac users i guess :p

Seriously, i don't see why it would be different for mac users, but you can test it yourself, create a lan game, add a computer and try if it works for you.

And plz give me the answer.

EDIT : Ok i've forgotten you can't compile vJass, i will add a demo map in the first post.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
EDIT : Ok i've forgotten you can't compile vJass, i will add a demo map in the first post.

I tried the demo map and it only said "away for 0 seconds", including when I switched to another app, and also when I hid WC3. (It doesn't really "minimize" - you can only switch to another app when you set WC3 to windowed mode [on the Mac, you can switch between fullscreen and windowed mode on the fly while playing.])

FYI, the "time away" counted up in-game when I scrolled the screen all the way to the right edge of the map and left it there.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
@Weep :
I have no idea how it works on a mac, but it should detect only if a player minimize wc3, i clearly said it doesn't detect any window mode.
So if you can't minimize wc3 on a map, then ofc it won't be detected.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
OK, but how useful is it to detect minimization then, if it doesn't detect someone putting WC3 in windowed mode and then going off to some other application for a while?

Also, what about the way it erroneously counted time away when the camera view was scrolled all the way to the right?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
OK, but how useful is it to detect minimization then, if it doesn't detect someone putting WC3 in windowed mode and then going off to some other application for a while?

Heh, i don't pretend that is useful, it's just fun, read the first sentence of the first post.

Also, what about the way it erroneously counted time away when the camera view was scrolled all the way to the right?
Why people never read totally the main post before post :banghead:

It will be fixed, i know it since i've written the code, hopefully it will be fixed but i've to improve more things before release a new code.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Code updated, i can't test it on battle.net for the moment but it still should work.

The functions name are annoying, but i hate call them Afk or Away, because it's so wrong.
Anyway if you really want use it, just copy paste the function names each time you want to call them.

Also it needs my personal sync library now, included in the first post.
I've tested only with a good host and 2 players, the needed time could be more than one second with more players and a bad host, therefore it would be totally useless.
If it's the case i will switch to the local unit selection stuff which should be faster.

Any constructive comments about the 2 libraries are welcome.

- Now the camera movements when an use press the arrows aren't stopped anymore.
- The bug when the camera is on top right is fixed.
- I've to hook the lock camera to unit functions, but then also PanCamera and such which should be lame if you pan the cam in sort periodic timers, because of TriggerEvaluate.
 

galled

Cool Member
Reaction score
0
Can you make a method to start the time of detection of the minimized window and another to stop the detection time? I say this to have the timer not running all the time.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Sure i can, but do you realize all the cons to detect if wc3 is minimized ?
You can't lock camera and you can't use it when a camerasetup or just a camera field which are currently applied during time, last time i checked it fucks up all the move.
Also you can't safely change the camera bounds.
About the target noise i haven't test it.

In other words, do you really need this thing ? Or the cons added will be more lame than the feature added itself (detect if wc3 is minimized)

But ofc i can make a function to enable/disable the check process.

EDIT : But keep in mind that the state detection will fire after it is effectively done, it isn't something instant.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
If the camera is moving, it -obviously- doesn't need to check if they're minimised. :)
Yes, but if wc3 is minimized, the X/Y of camera won't be changed, so the "system" will try to pan the camera, and then fuck up all the move when the player will be "back".
Tested and approved.
 

lscorpionl

New Member
Reaction score
0
Maybe you can detect if the player moves the Mouse or do something ingame per second for know if he is active in the game.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Maybe you can detect if the player moves the Mouse or do something ingame per second for know if he is active in the game.
Since we don't have natives functions to detect the mouse position it can't be done like that, maybe with Reinventing The Craft but with all his cons too.

In a perfect world where every player doesn't shut off the wc3 sound, i wouldn't need to pan the camera and it would detect properly when a player minimize his wc3, and so have no cons except that the detection is still not instant. (time needed to sync local datas)
But sadly we can't assume that.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top