Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Goombert

886
Finished Games / Re: Window Styler, Web Browser, and Embed Program
« on: September 28, 2014, 06:05:24 PM »
Quote from: TKG
So how do I do that?

Like this...

Code: (C++) [Select]
LRESULT CALLBACK DllChildWndProc (HWND hWndParameter, UINT message,WPARAM wParam, LPARAM lParam)
{
  switch (message) {
    case WM_CREATE:
      return 0;
  }
  return DefWindowProc(hWndParameter, message, wParam, lParam);
}

void somefunctionwhereyouwanttotakecontrolofthechildwindow() {
  SetWindowLong(childWindowhWnd, GWL_WNDPROC, DllChildWndProc);
}

Then you have complete control over all messages for the child control. (Y)

887
Finished Games / Re: Window Styler, Web Browser, and Embed Program
« on: September 28, 2014, 05:23:38 PM »
TKG, ok, do you have the handle to the control? What you would want to do is intercept all of its window messages, but I don't think that can be done without directly controlling it and delegating the messages.

It goes like this, in order to get WM_SIZE or WM_PAINT or other messages from the window, we hand it a process to its class/container which is used to create the window.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Platforms/Win32/WINDOWSmain.cpp#L224
We then process the messages.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Platforms/Win32/WINDOWScallback.cpp#L72
And if we want we can optionally pass messages right back to Win32 for Windows to handle the message itself.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Platforms/Win32/WINDOWScallback.cpp#L247

So what I am wondering if there is a way to take the handle of your control and attach it a message process after it has already been created. These are formally called Window Procedures.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632593%28v=vs.85%29.aspx

Found it
Use SetWindowLong with GWL_WNDPROC and you can change the window procedure to your own function and intercept all messages from the child control.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633591%28v=vs.85%29.aspx

888
Finished Games / Re: Window Styler, Web Browser, and Embed Program
« on: September 28, 2014, 04:50:38 PM »
Quote
The losing focus issue is because the browser controll is a seperate window being embedded in there, there's no way to fix that unless I re-write in c++.
Not necessarily, can't you just intercept the messages from the browser control handle?

889
Finished Games / Re: Window Styler, Web Browser, and Embed Program
« on: September 28, 2014, 01:58:29 PM »
TKG are you making use of Windows dll's? If that's the case that is likely what is causing the Internet Explorer hell, also why Windows has dll hell. It's a problem specific to Windows operating systems and devices.

https://en.wikipedia.org/wiki/DLL_Hell

This is also why Microsoft has GUID's and why we see them in Studio, applications should have unique identifiers to avoid Microsoft API's from getting confused and reading another ones messages or interops.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa373931%28v=vs.85%29.aspx
https://en.wikipedia.org/wiki/COM_Interop

I don't know all the details about it, but I've definitely heard of this before.

890
Developing ENIGMA / Re: git madness
« on: September 28, 2014, 01:42:26 PM »
Well, first, don't worry about the history Harri, it's already gone to shit for the most part several times in fact. This happens to be why I get very anxious about leaving pull requests setting around, they can and will become a nightmare after a while.

891
General ENIGMA / Externalizing LateralGM
« on: September 28, 2014, 01:33:21 PM »
I want to make the case for excluding several things from LateralGM's JAR and redistributing it as a zip file.

1) I want to externalize the file that configures all the keyboard shortcuts of the application to allow people to change the shortcuts.
https://github.com/IsmAvatar/LateralGM/issues/147
2) I want people to easily be able to add and change existing icon packs by placing them in a folder called icons and every top level folder will become a new icon pack.
3) I want to do the same thing I want to do for icons with languages and allow people to easily add new language packs.
4) I want to externalize all the LGL action libraries to a folder where LGM will load them to allow users the easy ability to add and remove action libraries as well as modify and utilize existing ones, even those made for GM since we already have the code to load them it doesn't make any sense not to offer the capability, obviously for legal purposes we use our own LGL format.

Anybody that knows me knows that I have never been one for creating applications that package everything into a single file, it has never been my thing and I strongly oppose it for several reasons. I like applications that you can easily modify without hassle or even having to know what you are doing, and I find this aspect of LateralGM to actually be against what makes LGM great, its free and open source nature.

892
Proposals / Re: GMS vs GM8.1 and below [window_handle()]
« on: September 27, 2014, 03:35:15 PM »
Ok TKG, but how do you propose we do that? Especially when you don't even know how Studio's works, ours just casts hWnd to unsigned long long.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Platforms/Win32/WINDOWSwindow.cpp#L812

893
Off-Topic / Re: Restructuring the Community
« on: September 27, 2014, 03:16:37 AM »
I can't view the link Lonewolff, what was that all about?

894
General ENIGMA / Re: Please vote for ENIGMA's new license
« on: September 27, 2014, 03:13:47 AM »
Hmmm I see your name in a couple of places where I'd think to look so ok I'll take your word for it.
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/subframes/RoomFrame.java#L6
Just remember to update headers of the files you change! I can not stress it enough. :)

895
Programming Help / Re: Script problem
« on: September 26, 2014, 03:46:38 PM »
Yes you could still do what I suggested, this is simply physics/calculus. rate of change = distance/time.

My original suggestion was this which gives us an exponential graph where velocity is the y-axis and distance is the x-axis.
Code: (EDL) [Select]
// with a room speed of 30 steps/frames per second you will get these speeds
// distance = 5, 5/10th pixel per step * 30 steps per second = 15 pixels per second
// distance = 10, 10/10th pixel per step * 30 steps per second = 30 pixels per second
// distance = 20, 20/10th pixel per step * 30 steps per second = 60 pixels per second
var spd;
spd = distance_to_point(xx, yy) / 10;
// you could also limit the speed if you like to some arbitrary value
if (spd > 30) {
  spd = 30;
}
move_towards_point(xx, yy, spd);

So let's just spruce up what I suggested first and you'll get a function similar to what you want that will accelerate up to a constant distance from any given point at which point it will slow down. You'll need to create a new variable called velocity in your create event and initialize it to 0.
Code: (EDL) [Select]
var dist;
dist = distance_to_point(xx, yy);
if (dist > 100) {
  // accelerate
  velocity += dist / 10;
} else {
  // we are getting close, so decelerate
  velocity -= (100 - dist) / 10;
}

// you could also limit the speed if you like to some arbitrary value
if (velocity > 30) {
  velocity = 30;
}
move_towards_point(xx, yy, spd);

If you like you can also use the built in variables with this alternative so you don't have to create a new one and you could also use the friction variable then as well.
Code: (EDL) [Select]
var dist;
dist = distance_to_point(xx, yy);
if (dist > 100) {
  // accelerate
  speed += dist / 10;
} else {
  // we are getting close, so decelerate
  speed -= (100 - dist) / 10;
}

// you could also limit the speed if you like to some arbitrary value
if (speed > 30) {
  speed = 30;
}

direction = point_direction(x, y, xx, yy);

896
Programming Help / Re: Script problem
« on: September 26, 2014, 02:18:12 PM »
Hmm I am not really sure I follow you though, because I don't see why you would need a script particularly for this as both GM and ENIGMA do have functions built in for this. For instance, move_towards_point sounds like it does exactly what you want this script to do.
http://enigma-dev.org/docs/Wiki/Move_towards_point

Additional Instance and Motion functions are documented here.
http://enigma-dev.org/docs/Wiki/Instance_and_Motion_Functions

The acceleration you can control yourself using the speed variable. You could also take the distance between the two points (Pythagorean theorem; also the point_distance function) and divide it by some arbitrary number and use that as the speed, then the object will be faster when it is further away and get exponentially slower as it gets closer and closer to the point.

897
Programming Help / Re: Script problem
« on: September 26, 2014, 01:01:25 PM »
Yes sir I can move it for you! You were looking for Programming Help. I would like to call your attention to the functions move_towards_point and mp_potential_step which are designed to move the object towards a point while avoiding other objects and such. Though the later of these functions is a little finicky in ENIGMA due to the difference in implementation however playing with the settings function for it does make it work. We currently have a ticket filed on it not working exactly the same as GM though.
https://github.com/enigma-dev/enigma-dev/issues/678

Additional details as to what you are looking to do would also be helpful, such as do you want to avoid other objects? Are you looking to calculate the shortest path and not just any path?

898
General ENIGMA / Re: Please vote for ENIGMA's new license
« on: September 26, 2014, 12:53:05 PM »
Mmmm, IsmAvatar, I am not sure about what you are saying because the extent to which ENIGMA and LGM work together is limited, the same could be accomplished in LGM with a Studio plugin which I had contemplated before. I think more of that would reside in the plugin for LGM wouldn't it? Or probably not since the license we want for ENIGMA is to stop people from fixing important bugs and closing off the source code to us.

899
General ENIGMA / Re: New Portable
« on: September 26, 2014, 01:08:11 AM »
Just want to update this post again I have uploaded the new portable zip with the instance system memory leak fix.
http://enigma-dev.org/docs/Wiki/Install:Windows

This was the pull request.
https://github.com/enigma-dev/enigma-dev/pull/835

900
Issues Help Desk / Re: Missing functions
« on: September 26, 2014, 12:45:52 AM »
Good work sorlok! Yes rodney we don't enable all functions by default because it helps to seriously reduce the executable size of games by ripping out the functions they do not need. We have not gotten around to the device_mouse functions and touch support yet but there has been a lot of requests and I already know how to write them so they'll be coming at some point in the future.  If you need further assistance do not be afraid to ask (Y)